Skip to content

Troubleshooting

hydrogen602 edited this page Apr 25, 2019 · 10 revisions

Troubleshooting

Good luck

  • Working on motor pi -> ssh pi@192.168.1.4
  • Working on camera pi -> ssh pi@192.168.1.3
  • Working on surface pi -> ssh pi@192.168.1.2

server2020.py, webSocketServer.py: OSError: [Errno 48] Address already in use

Likely there is still code running on the pi. Try finding the process id with ps aux | grep "server2020" or ps aux | grep "webSocketServer". If there is a process, use the left most number or the result of pgrep -f "server2020" or pgrep -f "webSocketServer" to get the process id. Kill the process with kill -9 [process id].

If that doesn't work, then find the line PORT = 8008 at the top of server2020.py and webSocketClient.py and change the port number to something else like 8009, 8010, or 8011 in both files on both motor pi and server pi. The port number MUST be the same across all the software.


motor2020.py or surface2020.py says stopping factory right after starting

If:

If the output contains a line of the like 58 Connection was refused by other side: 111: Connection refused., where the number in front (58 here) is going up every couple of seconds, then the code is automatically trying to reconnect.

Else:

The code might not be able to connect to the server. Press ^C (Control-C) and start the program again to try to reconnect.

In both cases:

Make sure server2020.py is up and running without errors on surface pi. Else check the ip address on motor2020.py on motor pi. The last line should read webSocketClient.start('motor', process, ip="192.168.1.2"), where 192.168.1.2 is the ip address of surface pi.


Some pygame not initialized or whatever

For who knows why, surface2020.py must be run in a terminal window of the raspberry pi, and CANNOT be run in an ssh session.


SyntaxError: invalid syntax or ModuleNotFoundError

The standard code used is for python3. Ensure that python3 someFile.py is used instead of python someFile.py, as that will run python 2.7.

Website Issues

You have issues


No new data / no data at all on dataSheet.html

  1. Don't use Chromium

  2. Wait 5-10 seconds

  3. Reload the page

  4. Check status.html. It should say Status: Running. If not, try:

    1. ssh into camera pi -> ssh pi@192.168.1.3
    2. run /var/www/scripts/dataCollection.sh start
    3. check status.html and dataSheet.html again
    4. Try step 4
  5. If on chrome -> right click -> inspect -> console

    1. If it says some error other than the likes of Error in connection establishment: net::ERR_CONNECTION_REFUSED, then the code has an error, RIP.
    2. If there are no errors except for the likes of ERR_CONNECTION_REFUSED, then try step 5.
  6. Check Logs

    1. run less /var/www/scripts/nohub.out
    2. visit page cgi-bin/getLog.py
    3. If either show an error, then your on your own.

Data shows on dataSheet.html, but many values are instead Error

Every once a while an error will show up in the data normally, but if they are continuous, the wiring is probably broken.

Using backup SD cards

The backup SD card's code may not be completely up to date

Hardware

test.py can be used to test individual motors. Motor number is the pin number, and power level is from 30 to 150.

Clone this wiki locally