PAN015 Update
Joe got the PAN015 unit powered this morning. There were problems uploading to the arduino and I connected to the unit with ssh to help.
There were several errors, such as:
getsync_500() not in sync
E: unable to connect, double check cable connection
After much debugging, the arduino problem was solved by killing all processes running on the serial port. This was done using:
fuser -k /dev/ttyACM0
Note that the dev path is unique depending on the system but should be /dev/ttyACM0 for practically all panoptes units.
sudo supervisorctl restart <pocs-daemon-server>
I got the jupyter lab tunnel working and started to test the unit. The mount did not work, and cameras appeared to work but no images were created.
To get the cameras to output images, I had to change the static path /home/panoptes/images/example_image_name.cr2
to /home/WISRD/images/example.cr2
.
This will be necessary for all POCS users whos username isn’t “panoptes”. Was able to scp file transfer the images from the remote unit to my local computer and view them.
I then started working on the mount. Firstly, had to set proper values using
pocs config set key value
The following key value pairs were set:
mount.commands_file 'ioptron/v250'
mount.driver 'panoptes.pocs.mount.ioptron.ieq30pro'
mount.serial.baudrate '9600'
PAN015 uses the ieq30pro equatorial mount. This is where I started running into several problems. The mount still did not work. It is unclear to me how the pocs daemons interact. I don’t know what needs to be restarted to update changes to the config server, and it was unclear how I would output debug messages within the jupyter notebook, and weather the updates made in python files would update in real time, or require restarting the daemons, namely the pocs-jupyter-server and pocs-config-server. I then decided to test our mount seperately from the POCS ecosystem. I created a python script that reads and writes to the mount using the pyserial module. Doing this, I found that the specified mount dev path /dev/ttyUSB0 was not communicating at the expected 9600 baudrate, but I was able to get output at 115200. This signaled that the dev path was incorrect. Looking into pyserial, I found this terminal command:
python -m serial.tools.list_ports
Which gave the output:
/dev/ttyACM0
/dev/ttyAMA0
/dev/ttyUSB0
/dev/ttyUSB1
4 ports found
For other POCS users who don’t know, dev paths are assigned based on first-time connection order of device, and try to reconnect to the same path each time that USB device is plugged into the system (things get weird and less reliable with USB hubs). We had plugged in our weather sensor first, so our “mount” serial port was actually for our weather station. Still using my test script for the mount, I changed the dev path to /dev/ttyUSB1
with a baudrate of 9600. Sent a check model handshake request to the mount along with a firmware version request and instantly received output. Our mount hardware works and handles serial communication perfectly. I then updated the pocs-config-server
daemon to use /dev/ttyUSB1
for our mount and restarted it. Although I don’t remember the exact order of events, I would end up power cycling the unit, restarting the daemons through the pocs cli (pocs <command> restart
) and supervisorctl restart
. No matter the action I took, the jupyter notebook would not accept that I wanted my mount to have a serial baudrate of 9600. I tried setting the value to a string and int, but it would always return a very strange datetime.datetime(9600, 1, 1, 0, 0)
object. I even tried to edit the datetime object in its string representation hoping that the communication databits category was wrong (8 instead of 1), but this also did not work. Even tried killing running process on /dev/ttyUSB1
and running from fresh system reboot with various config values for mount.serial.baudrate
. Everything I tried resulted in TestPOCS.ipynb
notebook failing with an attribute error in cell 3:
S 07-09 02:18:11.424 Unit says: Oh wait. There was a problem initializing: AttributeError("'Mount' object has no attribute 'serial'")
AttributeError: 'Mount' object has no attribute 'serial'
During handling of the above exception, another exception occurred:
This is occurring either because the mount.serial.baudrate
config value is wrong and requires very specific input which is not documented, or the POCS abstract ecosystem is not working properly.
Tech Help and Questions
@wtgee I’m hoping you can answer a few quick questions.
What is the proper way to specify a mount with a serial rate of 9600 with POCS?
Does the config server need to be restarted everytime a configuration value is changed?
Does the jupyter notebook server need to be restared everytime for those changes to take effect?
Will edits to source code be updated in realtime with the jupyter notebook?
In this ssh session I went through a good portion of the install and would like to share some useful info:
Dev path cheat sheet, where N is a integer:
arduino will be of the form: /dev/ttyACMN
mount and weather station will be of the form: /dev/ttyUSBN
python -m serial.tools.list_ports
Sharing PAN015/WISRD Testing Scripts
I’ve gone ahead and made a very basic debugging github since the forum doesn’t allow python files to be uploaded. I’ve included lsusbplus.py, which when run from the command line will list the dev path of devices which are connected directly to the pi (not through a USB hub) along with other information from lsusb, and mount_test_wisrd.py. The mount test script can be sued to confirm that the mount hardware works independently of pocs. The script will only work with the ieq30pro, and any 9600 baud mount using iOptron RS-232 Command Language Version 2.5. It is simple to edit the dev path and baudrate, and this approach will work for any mount, but be sure to use the correct USB handshake commands which can be found in yaml files (along with links to their documentation) at github.com/panoptes/POCS/resources/mounts. The test scripts I made can be found at https://github.com/thomazach/pocs_debugging_utils/tree/main