Setup payload Pi Computers

Time required

  • 30 Minutes

Parts required

  • 1xWaveshare Board CM4-IO-BASE-B

  • 1xRaspberry CM4 Board

  • 1xUSB-C Cable

  • 1xSW-AP1 Router (for wifi login)

Flash image to board

Configure

  • Login to pi via ssh to the default dronename from the image:

$ ssh searchwing@searchwing-drone

or via IP (get from router)

$ ssh searchwing@x.y.z.w
  • Do first boot setup:

    • Dronename is set in this script

    • Partition /data is resized to full disk size

$ sudo ./first_boot_setup.sh

Testing

Login

  • Connect cameras with thin camera cables

  • You can access each camera via its hostname:

$ ssh searchwing@perlman

or

$ ssh searchwing@perlman.local

Camera image taking

  • Check for new images using pi webserver

    • Open webbrowser

    • Go tohttp:\\perlman

    • Click on 0_latest.jpg@

    • The most recent image should appear (and can be refreshed using browser refresh / F5-key)

    • You can also check if new images appear in the main list

  • For debugging you check output of the image payload:

$ journalctl -f -u searchwing_payload.service
  • If the progress is stopped, most probably the pi camera cable isnt working properly

DHT22

$ python /home/searchwing/testdh22.py 
A full buffer was not returned. Try again.
Temp: 67.1 F / 19.5 C    Humidity: 38.9% 
Checksum did not validate. Try again.
A full buffer was not returned. Try again.
Temp: 66.6 F / 19.2 C    Humidity: 41.5% 
Temp: 66.7 F / 19.3 C    Humidity: 46.7% 
A full buffer was not returned. Try again.
A full buffer was not returned. Try again.
Checksum did not validate. Try again.
Temp: 76.8 F / 24.9 C    Humidity: 99.9% 
Temp: 77.4 F / 25.2 C    Humidity: 99.9% 
  • Stop payload as it uses serial port already

$ sudo systemctl stop searchwing_payload
  • Connect to the flightcontroller via mavproxy

$ mavproxy.py --master=/dev/ttyS0,57600
  • After a few seconds, the connection should be established

Connect tcp:127.0.0.1:5760 source_system=255
Log Directory: 
Telemetry log: mav.tlog
Waiting for heartbeat from tcp:127.0.0.1:5760
MAV> online system 1
RTL> Mode RTL
  • On the Pi with RX/TX connected to the pixracer you can now test TX

    • Set the plane to Manual Mode

    • Set mode MANUAL by writing to the prompt:

mode MANUAL 
  • Observe if the output is as following:

RTL> Got COMMAND_ACK: DO_SET_MODE: ACCEPTED 
MANUAL> Mode MANUAL
  • The plane should be now in manual mode

Debugging (deprecated)

  • using searchwing-pi repo / searchwing-payload-camera

    • set LOGGER_LEVEL = "DEBUG"in /home/searchwing/searchwing-pi/configuration.toml

    • restart: sudo systemctl restart searchwing-payloads-camera.service

    • Check output

    $ journalctl -f -u searchwing-payloads-camera.service
  • using mavlink-router stats per port

    • enable mavlink-router stats printing in /etc/mavlink-router/config.d/main.conf

    [General]

    ReportStats=true

    MavlinkDialect=auto

    • restart mavlink-router: sudo systemctl restart mavlink-router.service

    • Check output

    $ journalctl -f -u mavlink-router.service

Last updated