airvolute / dcs-deploy

GNU General Public License v3.0
1 stars 0 forks source link

PX4 Orange Cube issues on board 1.2 on Jetpack 5.1 #7

Closed PavelGuzenfeld closed 1 year ago

PavelGuzenfeld commented 1 year ago

Hello,

We experiencing the following issue on with orange cube on board 1.2:

  1. I's not possible to update firmware on the board. when using the old board with the same Orange Cube , updating firmware works fine.
  2. When powering the board while Orange Cube is connected via USB to a pc with QGC the following happens: 2.1 Orange Cube starts and connects to QGC. 2.2 Ubuntu boots up and the Orange cube is disconnected form QGC. 2.3 I's not possible to reconnect to Cube via QGC. 2.4 Drone app is not able to connect to Orange Cube. Requires many resets to boot correctly.
eMrazSVK commented 1 year ago

Hello, can you please boot the device and :

  1. Show me output of command sudo uhubctl ?
  2. Also, which USB port are you exactly using? Developer micro-usb on DCS pilot board, or CUBE usb port?
  3. What requires many resets to boot correctly? Cube or Xavier? Please elaborate on this.

Thank you.

eMrazSVK commented 1 year ago

Additionally, you can try connecting USB to CUBE after the Ubuntu boot.

PavelGuzenfeld commented 1 year ago

Hello Eduard, Thank you for your prompt response. We are using Xavier on Airvolute1.2 with Jetpack 5.1.

The use case in question is monitoring the Cube over QGC by connecting cube's USB port to a laptop with. In addition, the board is connected to another laptop via micro-USB debug port over SSH. The issue happens only when powering up the board Cube. The board starts up and connects to QGC as expected but shortly after it disconnects and requires manual reconnection. This did not happen with the old setup, (i.e. Xavier on Airvolute1.0 with Jetpack 4.6).

I've connected the Orange Cube to one of the USB ports and here is the result: dcs_user@dcs:~/workspace$ sudo uhubctl [sudo] password for dcs_user: Current status for hub 2-3 [0424:5816 Microchip USB5816 Smart Hub, USB 3.20, 5 ports] Port 1: 0203 power 5gbps U0 enable connect [0bda:8153 Realtek USB 10/100/1000 LAN 001000001] Port 2: 06a0 power Rx.Detect Port 3: 06a0 power Rx.Detect Port 4: 06a0 power Rx.Detect Port 5: 06a0 power Rx.Detect Current status for hub 1-2 [0424:2816 Microchip USB2816 Smart Hub, USB 2.10, 7 ports] Port 1: 0100 power Port 2: 0507 power highspeed suspend enable connect [2560:c181 e-con Systems e-CAM82_USB 01.00.0000] Port 3: 0507 power highspeed suspend enable connect [2560:c181 e-con Systems e-CAM82_USB 01.00.0000] Port 4: 0103 power enable connect [2dae:1016 CubePilot CubeOrange 0] Port 5: 0100 power Port 6: 0000 off Port 7: 0503 power highspeed enable connect [0424:2840 Microchip Hub Feature Controller]

eMrazSVK commented 1 year ago

Is it not possible to connect the CUBE AFTER the boot sequence?

If I understand you correctly, you are trying to upload the firmware. I recommend doing following:

  1. Do not plug CUBE's micro usb port to the board.
  2. Boot the DCS board.
  3. After the successful boot, plug micro USB into the CUBE on one side and into the laptop on the other side.
  4. Start the flashing process
  5. You can reboot the CUBE using GCS app.
  6. Firmware should be updated at this point.

Later, I can provide you with a script, that would bypass the use of CUBE's micro usb port and you could use DCS's micro USB port for FCU firmware updating.


Little bit of background of what's happening:

As it can be seen from your output:

...
Current status for hub 1-2 [0424:2816 Microchip USB2816 Smart Hub, USB 2.10, 7 ports]
Port 1: 0100 power
Port 2: 0507 power highspeed suspend enable connect [2560:c181 e-con Systems e-CAM82_USB 01.00.0000]
Port 3: 0507 power highspeed suspend enable connect [2560:c181 e-con Systems e-CAM82_USB 01.00.0000]
Port 4: 0103 power enable connect [2dae:1016 CubePilot CubeOrange 0]
Port 5: 0100 power
Port 6: 0000 off
# ^^^^^^ notice this
Port 7: 0503 power highspeed enable connect [0424:2840 Microchip Hub Feature Controller]

Port 6 is disabled by default. Port 6 is used for USB connection between the CUBE and the DCS board. This is BY DEFAULT disabled, because by default, customers connect their PCs using CUBE's USB port. Port 6 is disabled shortly after the boot. At this little tiny time after Linux boot, the port is active and is connected to both QGround and to the DCS board, so it basically has two masters, which could result into undefined behaviour, that's why the CUBE disconnects after a while and that's why I recommend you to connect CUBE into your laptop short time after the boot is complete. You can check the output of uhubctl command and if the Port 6 is off, you can connect the micro USB to the CUBE.

I hope this helps.

PavelGuzenfeld commented 1 year ago

Hello Eduard,

Thanks for your informative response. Indeed sometimes we try to load custom firmware but other times just monitor the drone's flight. Any way, assuming I would like to cancel the command disabling port 6. How is it done? Kind regards, Pavel

eMrazSVK commented 1 year ago

For monitoring drone's flight you can use plethora of tools, including mavros, mavlink router, Mavproxy specifically its feature Telemetry GCS Forwarding. You can forward telemetry data to specific network interface (wifi) with (most commonly) TCP/UDP protocol. This will work on our devices.

To disable automatic disabling of port 6, you can use this command (on Xavier):

sudo systemctl disable usb_hub_control.service

You can take a look what's going on in there here: https://github.com/airvolute/dcs-deploy/tree/main/resources/usb_hub_control

I assume you have all information you need. I will close the issue now. In case you have more questions, feel free to open a new issue :blush: