problem connecting terminal to pilot

32 views
Skip to first unread message

Luke Sjulson

unread,
Oct 25, 2020, 12:26:50 PM10/25/20
to autopilot-users
hello,

I'm having problems getting the terminal and pilot to talk to each other. The pilot is an RPi 4B running 32 bit Raspbian Lite, and the terminal is a macbook pro running OS X, both Python 3.7. I'm attaching a screenshot below. The left side of the screen is the terminal GUI on OS X, and I don't see the green button or plus/minus below the pilot's name like shown in the docs. When I try to run a bandwidth test, it just starts running and nothing happens. The right side of the screen is an SSH window showing the pilot. It seems like autopilot is already running in the background, and I get an error if I try to launch it manually. As far as I can tell, the two machines aren't communicating. When I add the pilot (bumbrlik01) to the terminal, it doesn't seem to autodetect it in any way, and I had to add the IP number to the pilot_db.json file manually. Both machines have static IPs, and as far as I can tell, the prefs.json files specify those correctly.

I wasn't able to make much sense of the logfiles, but I'm attaching them in case they make clear what the issue is.

Any tips? Thanks!

Luke



terminal_problem.jpg
terminal_logs.zip
pilot_log.tar.gz

Luke Sjulson

unread,
Oct 25, 2020, 12:49:28 PM10/25/20
to autopilot-users
The one encouraging thing is that when autopilot is running on either machine, I can ping port 5565 (but not 5560) successfully from the other one.

pi@bumbrlik01:~/autopilot $ nc -vz 192.168.1.160 5560
nc: connect to 192.168.1.160 port 5560 (tcp) failed: Connection refused
pi@bumbrlik01:~/autopilot $ nc -vz 192.168.1.160 5565
Connection to 192.168.1.160 5565 port [tcp/*] succeeded!


jlsaun...@gmail.com

unread,
Oct 25, 2020, 6:16:36 PM10/25/20
to autopilot-users
It looks like you're getting a bug from launching pigpio, in the Pilots_Log you can see this error being thrown:

2020-10-25 16:13:31,332 ERROR : pigpio was not found in autopilot.external
Traceback (most recent call last):
  File "/home/pi/github/autopilot/autopilot/core/pilot.py", line 580, in init_pigpio
    self.pigpiod = external.start_pigpiod()
  File "/home/pi/github/autopilot/autopilot/external/__init__.py", line 59, in start_pigpiod
    raise ImportError('pigpio was not found in autopilot.external')
ImportError: pigpio was not found in autopilot.external

this has to do with the way pigpio used to be launched, that should be fixed in v0.3.3 (just pushed).

should add this to a general 'debugging' section of the docs: to see the stdout of autopilot when running as a systemd service, use
journalctl -u autopilot -e

let me know if still having issues

Luke Sjulson

unread,
Oct 26, 2020, 10:44:43 AM10/26/20
to jlsaun...@gmail.com, autopilot-users
Thanks, Jonny. I upgraded both to v0.3.3, and it did fix the pigpio launching issue. There is still a problem where jackd isn't running, but I suspect this has something to do with the default settings assuming the existence of the audio hat.

However, I still can't get them to connect over the network. I've spent maybe 6-8 hours over the weekend trying everything I can think of, and I'm out of ideas. Do you have any tips for troubleshooting the network issues? I'm attaching a screenshot that I think captures the issue. The debug messages for both sides say that messages are sent, but neither side says messages are received. 

One question: are the push and message ports supposed to be the same on both? For example, should they both have 5560 for the push port and 5565 for the message port? Or should one have 5560 for push and the other have 5560 for message? 

Also, I killed the systemd-launched autopilot on the pi and have been launching it manually. I tried both as a regular user and root. Would either of those affect this?

thanks,

Luke


--
Lucas L. Sjulson, MD, PhD
Assistant Professor
Department of Psychiatry and Behavioral Sciences
Dominick P. Purpura Department of Neuroscience
Albert Einstein College of Medicine
Rose F. Kennedy Center, Room 227
1410 Pelham Parkway South, Bronx, NY 10461
office: 718-430-2453, lab: 718-430-4271


--
You received this message because you are subscribed to a topic in the Google Groups "autopilot-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/autopilot-users/AObzcMNNDIE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to autopilot-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autopilot-users/76d1cc6d-f1b9-4eb0-b858-081084451714n%40googlegroups.com.
Screen Shot 2020-10-26 at 10.19.32 AM.jpg

Luke Sjulson

unread,
Oct 26, 2020, 6:00:51 PM10/26/20
to jlsaun...@gmail.com, autopilot-users
hi Jonny,

I finally got it to work, but I don't think I tried anything that I hadn't already tried before, so I'm not sure what the problem was. The one thing is that I was unsure whether the push port on one is supposed to be the message port on the other. I figured it out, but future users might benefit from that being spelled out a little more explicitly in the documentation.

thanks,

Luke


--
Lucas L. Sjulson, MD, PhD
Assistant Professor
Department of Psychiatry and Behavioral Sciences
Dominick P. Purpura Department of Neuroscience
Albert Einstein College of Medicine
Rose F. Kennedy Center, Room 227
1410 Pelham Parkway South, Bronx, NY 10461
office: 718-430-2453, lab: 718-430-4271

jlsaun...@gmail.com

unread,
Oct 27, 2020, 8:28:29 PM10/27/20
to autopilot-users
Glad you got it to work!!!

The audio server is currently a little brittle, yes -- the assumption of the hifiberry hat is in the 'JACKD_STRING' of prefs -- replace the '-d' flag with reference to your device, man page here: https://linux.die.net/man/1/jackd

I apologize for the unclarity in the docs, agreed that more work needs to be done there. this has been noted in a previous thread and i gave a brief explanation there: https://groups.google.com/g/autopilot-users/c/JvWIPpYY0TI/m/qYCgVvcaAQAJ

in short -- 'MSGPORT' is the port that a Station object listens for incoming messages, and 'PUSHPORT' is the port that it connects to on another computer -- so yes the PUSHPORT on one should be the MSGPORT on the other.

Longterm plan for networking modules is to have a better announce/discovery routine where networking objects would all bind some common 'handshake' port, and on connection spray announce packets at some IP range to find the rest of the autopilot-networked agents it can see, and then keep track of a DHT such that you wouldn't need to explicitly configure any of it and could just address messages like "agent_name.node_name" like "Pilot_1.LED_C" to send messages to an LED.

There are some differences when launching as a systemd process than from the script directly -- most notably the user that owns the processes, which would affect any shell variables/etc you declare, but this has only been an issue when i've had conflicts between system and user PATH. to disable the systemd service permanently you can use
sudo systemctl disable autopilot
which should prevent it from launching at start.

also opened an issue to remind me to write these docs: https://github.com/wehr-lab/autopilot/issues/24
Reply all
Reply to author
Forward
0 new messages