Keyboard Shortcuts
Likes
- Ibcalpha
- Messages
Search
Re: Problem witrh Gateway 10.22
开云体育You should have let the installer install to its default location, which is /home/pranav/Jts/ibgateway/1022 ? This being the case, IBC should find the jars folder at /home/pranav/Jts/ibgateway/1022/jars. If it’s not there, it must be because you didn’t use the installer’s default location. ? If you actually used the TWS installer, the default location would be /home/pranav/Jts/1022, and the jars folder would be at /home/pranav/Jts/1022/jars ? Since IBC isn’t finding the jars folder, either you didn’t install the standalone (offline) version, or you changed the installer’s location from the default. ? By the way, you don’t seem to have successfully deployed the updated IBC.jar and version files, as your logfile still says it’s IBC 3.16.2, not 3.16.3. ? Richard ? |
Re: Problem witrh Gateway 10.22
开云体育Hi Richard and all, ? I upgraded to version 1022 and have updated to the file mentioned in the below message. However, ibc is unable to find the gateway. ? I have installed in the standard path. ? ? I have attached the complete ibc log to this message. Pranav ? From: [email protected] <[email protected]> On Behalf Of Richard L King
Sent: Tuesday, April 11, 2023 2:31 AM To: [email protected] Subject: [ibc] Problem witrh Gateway 10.22 ? [NB: if you are not trying to use Gateway 10.22 there is no need for you to take any action, so just ignore this.] ? It’s come to my attention that IBC 3.16.2 and earlier doesn’t work properly with Gateway 10.22: it fails to fill in the username and password when logging in (but TWS 10.22 is fine). ? This is because of a change to the window title of the login dialog that IB have made: it used to be ‘IB Gateway’ and now it’s ‘IBKR Gateway’. Consequently IBC doesn’t recognise it as the login dialog, and ignores it. ? I have fixed the problem and a new version is accessible on GitHub, but I haven’t actually yet created a new release in the usual way. There are other things that need to go into the next release, and I’m not quite ready for it. ? So in the meantime you can download the new version of the following files from : ? IBC.jar version ? Just download these two files directly and copy them over the current versions in your IBC installation folder. No other changes are necessary. ? After deploying these files, IBC will identify as version 3.16.3 in the logfiles. ? Richard ? |
Re: Newbie Qn
开云体育Well, I think you really need to fix the problem with TightVNC. I can’t give you any advice about that. ? Other than that, not sure what you can do other than standard Linux commands over SSH. ? Regarding log files, IBC took a silly decision several years ago to encrypt the Gateway and TWS logfiles, as you’ve discovered. The launcher.log file only contains information from the startup phase, so it will never tell you about anything later. And to view the encrypted logfiles you have to use the GUI, which is a bit tricky if your VNC session is inaccessible (you REALLY need to fix that problem…!). ? The only other thing is the IBC logfile, but that won’t tell you much either. Though if IBC has shutdown for some reason, that should be recorded in the logfile. ? Oh, there is one other possibility: you can use IBC’s command sever port (see the settings for this in config.ini) to send a dummy command, say “HELLO”, and you’ll get an ‘ERROR Command invalid’ response if IBC is running. You can send such a command using telnet, for example: ? telnet 10.252.0.7 7462 ? Here 10.252.0.7 is the IP address of my server running Gateway, and 7462 is the port number configured for the IBC command server. This will start an interactive telnet session if IBC is running, then just type in any command (other than STOP and RESTART which do exactly what they say). ? Alternatively you could script this: ? (echo restart; sleep 1; echo "HELLO" ) | telnet 10.252.0.7 7462 ? Richard |
Newbie Qn
I'm attempting to run IBC on AWS lightsail (ubuntu).
I have basically followed the directions from :? When I connect to my running IBC/GW instance using TightVNC all is good until it isnt. i.e if my computer goes to sleep or restarts I can't get back in to see what is going on My question is how do I know if my GW is still running when my viewing terminal is lost, i.e my client (local computer) has an evernt, (like it goes to sleep or something worse) I can't seem to get any information out the /Jts/launcher.log file. The last line useful is always? 2023-04-13 08:25:34.309 [AG] INFO? [JTS-PostAuthenticateS2-24] - Switching to a new encrypted log... And then I don't see any logging info |
Problem witrh Gateway 10.22
开云体育[NB: if you are not trying to use Gateway 10.22 there is no need for you to take any action, so just ignore this.] ? It’s come to my attention that IBC 3.16.2 and earlier doesn’t work properly with Gateway 10.22: it fails to fill in the username and password when logging in (but TWS 10.22 is fine). ? This is because of a change to the window title of the login dialog that IB have made: it used to be ‘IB Gateway’ and now it’s ‘IBKR Gateway’. Consequently IBC doesn’t recognise it as the login dialog, and ignores it. ? I have fixed the problem and a new version is accessible on GitHub, but I haven’t actually yet created a new release in the usual way. There are other things that need to go into the next release, and I’m not quite ready for it. ? So in the meantime you can download the new version of the following files from : ? IBC.jar version ? Just download these two files directly and copy them over the current versions in your IBC installation folder. No other changes are necessary. ? After deploying these files, IBC will identify as version 3.16.3 in the logfiles. ? Richard ? |
Re: IBC 3.16.2 prints version 3.15.2?
开云体育The version number shown in the window is taken from a text file called ‘version’ (no file extension) that is located in your IBC folder. ? When you upgrade by putting a new IBC.jar file in that folder, you must also copy in the corresponding ‘version’ file. ? So I suspect your ‘version’ file is just out-of-date. ? Richard ? ? From: [email protected] <[email protected]> On Behalf Of Kevin Jameson
Sent: Thursday, April 6, 2023 2:33 PM To: [email protected] Subject: [ibc] IBC 3.16.2 prints version 3.15.2? ? Suddenly last Sunday IBC and TWS wouldn't do reliable logins. TWS 1019g claimed IBC 3.15.0 was sending invalid login/passwords. After 3 or 4 tries TWS would log in and abort after starting to show my quote windows and charts. I started to use manual logins for the past three days, until today, when I upgraded IBC 3.16.2. The first login after upgrading was flawless, but I noticed in the CMD window for DisplayBannerAndLaunch.bat the IBC version was 3.15.2, not 3.16.2 as expected. Thank you Richard for your work! Life is so much easier with IBC and auto-restarts through the week. + + IBC version 3.15.2 + + Running TWS 1019 at 2023-04-06 13:23:49.64 + + Diagnostic information is logged in: + + C:\IBC\Logs\xxxx\IBC-3.15.2_TWS-1019_THURSDAY.txt + + + ** Caution: closing this window will close TWS 1019 ** |
Re: dual setup
...looking further into this, perhaps the entire endeavour to delete log files was misguided from the start as? perhaps these should not be created an saved there....although I am pretty sure I originally set this up because there were a massive number of log files at some point being saved into those folders, but I have completely forgotten why.
|
dual setup
Hi Richard -
Just noticed something I haven't beent tracking for awhile. The dual setup instructions in the IBC master user guide suggests setting up two different Jts folders (jtspaper, jtslive for example) for Ibdir to point to in the separate ibc config files that the bash start scripts (paperstart.sh, livestart.sh) read. Nothing seems to have been saved in these folders (or subfolders) for over a year. Fwiw the TWS_PATH in the gateway start scripts still point to ~/Jts and there seem to have two long named subfolders which are constantly updating. Everything is working absolutely beautifully so I perhaps neednt worry, except that I have a script which is supposed to deletes file every few days to clean up the jtslive and jtspaper folders to save on stoarage and of course this is not doing anything as no new files are being created so just checking if this is expected behaviour in the newer versions of IBC (I am using the latest release) and whether IbDir is still a required/useful setting in config files. Not the most exciting question but worth asking to help me manage my data storage. Thanks! |
Re: commandsend.sh failed
开云体育Line 26 has a DOS comment indicator rather than a Bash one at the start of the line. Hence the error. It should be like this: ? #============================================================================== ? Your question reminds me that I haven’t yet published these scripts in the repository, so I’ll do that soon. ? ? ? From: [email protected] <[email protected]> On Behalf Of Lam Kenneth
Sent: Monday, April 3, 2023 2:12 PM To: [email protected] Subject: Re: [ibc] commandsend.sh failed ? Here is the content of the commandsend.sh ? ? #!/bin/bash ? # Sends a command to the specified instance of IBC, for example to cause it # to initiate a tidy closedown or restart of TWS or Gateway ? # You must supply the command as the first argument when you call this # script. It is case-insensitive. ? ? # Please read the notes below and make any required changes, then save this # file before running it. ? # You may need to change this line. Set it to the name or IP address of the? # computer that is running IBC. Note that you can use the local loopback? # address (127.0.0.1) if IBC is running on the current machine. ? server_address=127.0.0.1 ? # You may need to change this line. Make sure it's set to the value of the? # CommandServerPort setting in config.ini: ? command_server_port=7462 ? ? # You shouldn't need to change anything below this line. ::============================================================================== ? ? if [[ -z "$1" ]]; then ????????????? >&2 echo -e "Error: you must supply a valid IBC command as the first argument" ????????????? >&2 exit 1 fi ? # send the required command to IBC? (echo "$1"; sleep 1; echo "quit" ) | telnet "$server_address" $command_server_port ? 「Lam Kenneth via <kennethlam999=[email protected]>」在 2023年4月3日 週一,下午9:09 写道:
|
Re: commandsend.sh failed
Here is the content of the commandsend.sh #!/bin/bash # Sends a command to the specified instance of IBC, for example to cause it # to initiate a tidy closedown or restart of TWS or Gateway # You must supply the command as the first argument when you call this # script. It is case-insensitive. # Please read the notes below and make any required changes, then save this # file before running it. # You may need to change this line. Set it to the name or IP address of the? # computer that is running IBC. Note that you can use the local loopback? # address (127.0.0.1) if IBC is running on the current machine. server_address=127.0.0.1 # You may need to change this line. Make sure it's set to the value of the? # CommandServerPort setting in config.ini: command_server_port=7462 # You shouldn't need to change anything below this line. ::============================================================================== if [[ -z "$1" ]]; then >&2 echo -e "Error: you must supply a valid IBC command as the first argument" >&2 exit 1 fi # send the required command to IBC? (echo "$1"; sleep 1; echo "quit" ) | telnet "$server_address" $command_server_port 「Lam Kenneth via <kennethlam999=[email protected]>」在 2023年4月3日 週一,下午9:09 写道:
|
commandsend.sh failed
Hi, the group manager, /home/kenneth/IBC/commandsend.sh: line 26: ::==============================================================================: command not found Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. OK Restarting at 05:39 PM Connection closed by foreign host. I hope you could shred me some light over this. I look forward to your reply. Many thanks.? Best regards, Kenneth |
Re: IBC Version 3.16.0
Fwiw, happy to report that the new autorestart works like a dream, what a fantastic achievement Richard. Hopefully means I won't get woken at 3am by pushover telling me to re-athenticate gateway restart as has occasionally been the case over the last few weeks.
Thank for this! Mark |
Re: IBC Version 3.16.0
开云体育Fully understand. Thanks Richard, currently testing the latest release with your Python code (slightly modified with the changes suggested).?Mark On 21 Mar 2023, at 20:31, Richard L King <rlking@...> wrote:
|
Re: IBC Version 3.16.0
开云体育Mark ? You asked: ? I don't know if you plan to apply a default port and IP setting in config.ini in the next release to allow scripts to work off the bat or this will be left blank. Should I wait for your next release, before making the relevant adjustment? ? I don’t intend to make any changes to what’s currently in the config.ini regarding these settings. Very few people use the command server at all, though that might increase a little as a result of the ‘restart’ command being available. So I think the default that the command server port is zero (ie not listening for connections) is sensible. The local host can always send commands if the command server is enabled, so there is no need for a default for the ControlFrom setting, and indeed there is no viable default other than localhost. ? So the upshot is that the user will always have to do something in config.ini to use the command server, and won’t be able to use it ‘out of the box’. ? Richard ? ? From: [email protected] <[email protected]> On Behalf Of Mark Murari
Sent: 18 March 2023 07:42 To: [email protected] Subject: Re: [ibc] IBC Version 3.16.0 ? Hi Richard,? import socket import time ? # The address and port of the local IBC command server TCP_IP = '127.0.0.1' #localhost TCP_PORT = {tbc as in config.ini} ? # The message to send to the IBC command server to request a restart RESTART_COMMAND = 'RESTART\n' ? # The buffer size for receiving data from the IBC command server BUFFER_SIZE = 1024 ? # Connect to the IBC command server and send the restart command with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: ? ? sock.connect((IBC_SERVER_ADDRESS, IBC_SERVER_PORT)) ? ? sock.sendall(RESTART_COMMAND.encode()) ? ? ? # Receive and discard any data from the IBC command server ? ? data = sock.recv(BUFFER_SIZE) ? ? print(f"received data: {data}") ? ? time.sleep(1) ? ? print("closing socket") ? print("exiting script") ? |
Re: IBC Version 3.16.0
EDIT - inconsistent use of names in last post:
import socket
import time
?
# The address and port of the local IBC command server
TCP_IP = '127.0.0.1' #localhost
TCP_PORT = {tbc as in config.ini}
?
# The message to send to the IBC command server to request a restart
RESTART_COMMAND = 'RESTART\n'
?
# The buffer size for receiving data from the IBC command server
BUFFER_SIZE = 1024
?
# Connect to the IBC command server and send the restart command
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
? ? sock.connect((TCP_IP, TCP_PORT))
? ? sock.sendall(RESTART_COMMAND.encode())
?
? ? # Receive and discard any data from the IBC command server
? ? data = sock.recv(BUFFER_SIZE)
? ? print(f"received data: {data}")
? ? time.sleep(1)
? ? print("closing socket")
?
print("exiting script") |
Re: IBC Version 3.16.0
Hi Richard,?
Fwiw this is my localhost version using socket. Very similar to yours except I prefer context managers and f strings which true pythomistas will insist makes it more pythonic (in case you care a smidgen :)). I don't know if you plan to apply a default port and IP setting in config.ini in the next release to allow scripts to work off the bat or this will be left blank. Should I wait for your next release, before making the relevant adjustment? import socket
import time
?
# The address and port of the local IBC command server
TCP_IP = '127.0.0.1' #localhost
TCP_PORT = {tbc as in config.ini}
?
# The message to send to the IBC command server to request a restart
RESTART_COMMAND = 'RESTART\n'
?
# The buffer size for receiving data from the IBC command server
BUFFER_SIZE = 1024
?
# Connect to the IBC command server and send the restart command
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
? ? sock.connect((IBC_SERVER_ADDRESS, IBC_SERVER_PORT))
? ? sock.sendall(RESTART_COMMAND.encode())
?
? ? # Receive and discard any data from the IBC command server
? ? data = sock.recv(BUFFER_SIZE)
? ? print(f"received data: {data}")
? ? time.sleep(1)
? ? print("closing socket")
?
print("exiting script")
|
Re: IBC Version 3.16.0
开云体育Mark ? As it happens, today I worked out a Python script for sending commands to IBC (see below): this was as part of an ongoing discussion relating to an issue in the IBC repository on Github. ? I’m not a Python user, so it took me a while to get it to work: it’s based on something I found in the Python Wiki (see ), which is a little out-of-date. ? This works fine as a free-standing script so it can be run from the? command line in either Windows or Linux, but it would be easy to incorporate it into a Python program. ? I’ll probably add something like this to the IBC download, as it’s better and more versatile than the current Stop.bat/Restart.bat files (apart from the need to install Python, but that is straightforward). ? Here’s the script: ? #!/usr/bin/env py ? import socket import time ? ? TCP_IP = '10.252.0.7'??? # IP address or name of computer running TWS TCP_PORT = 7463????????? # CommandServerPort setting in config.ini: BUFFER_SIZE = 1024 ? MESSAGE = b"RESTART\n"? # Command to send to IBC ? s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((TCP_IP, TCP_PORT)) ? print("sending: ", MESSAGE) s.send(MESSAGE) ? data = s.recv(BUFFER_SIZE) print("received data:", data) ? time.sleep(1) ? print("closing socket") s.close() ? print("exiting script") ? ? ? From: [email protected] <[email protected]> On Behalf Of Mark Murari
Sent: 17 March 2023 19:11 To: [email protected] Subject: Re: [ibc] IBC Version 3.16.0 ? Working quite slowly through my upgrade todo list, I am luckily at the point where I am trying to enable the recent restart function in Linux (via python). This python code should work but and pointers as to where I can locate the correct command server address and port would be appreciated, or do I need to explicitly configure these myself? ? |
Re: IBC Version 3.16.0
Hi Mark,
as far as I know, you need to configure those yourself explicitly. See the file config.ini, section #8 "IBC Command Server Settings" and the settings under this section
Max |