Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Devices connected to UART #299

Closed
JulV94 opened this issue Apr 17, 2018 · 7 comments
Closed

Multiple Devices connected to UART #299

JulV94 opened this issue Apr 17, 2018 · 7 comments

Comments

@JulV94
Copy link

JulV94 commented Apr 17, 2018

Hi,
I have a Matrice 100 drone and I need to connect 2 devices to it, fortunately there is 2 UART_CAN2 ports available on the drone. The first device is a SabreLite and the other is a Raspberry Pi 3 B+. When I connect one of the 2 it works perfectly but when I connect the 2 at the same time, one doesn't work. I got this error on the raspberry pi side :

Read App ID
User Configuration read successfully.


STATUS/1 @ init, L55: Attempting to open device /dev/ttyUSB0 with baudrate 115200...

STATUS/1 @ init, L65: ...Serial started successfully.

ERRORLOG/1 @ getDroneVersion, L1339: Drone version not obtained! Please do not proceed.
Possible reasons:
    Serial port connection:
        * SDK is not enabled, please check DJI Assistant2 -> SDK -> [v] Enable API Control.
        * Baudrate is not correct, please double-check from DJI Assistant2 -> SDK -> baudrate.
        * TX and RX pins are inverted.
        * Serial port is occupied by another program.
        * Permission required. Please do 'sudo usermod -a -G dialout $USER' (you do not need to replace $USER with your username). Then logout and login again

ERRORLOG/1 @ activate, L1228: Unable to initialize some vehicle components!
STATUS/1 @ getErrorCodeMessage, L644: initVehicle
STATUS/1 @ getCommonErrorCodeMessage, L710: ACK_NO_RESPONSE_ERROR
Vehicle not initialized

Everything listed in the possible reason cannot be the reason sinnce the code is working as soon as I remove the SabreLite. And for the Serial ports used, I've used each UART_CAN2 ports so I assume they are different ports. The 2 devices don't use the same version of the OSDK, maybe that's the reason, is the UART protocol used by the drone dependent of the OSDK version?

@AutisticNinja
Copy link

I'm pretty sure if you check those two ports with a multimeter you'll find that they are wired together directly. As such what you're trying to do is not likely to work.

If one of the devices only needs to listen you could connect up just it's RX line tot he TX on the M100. You can also use diode logic to OR the transmit from your two devices together, but you'll need to arbitrate the communications somehow to prevent collisions.

@rohitsantdji
Copy link

@AutisticNinja is right, there is a single UART within the M100 that is broken out into two ports for ease of access, not for connecting multiple devices simultaneously. In fact, trying to send data from two computers will cause both to behave erratically.

@JulV94
Copy link
Author

JulV94 commented Apr 20, 2018

Thank you for the fast responses.

I forked the code and managed to connect 2 devices on the drone by bypassing the acknowledgement part. Of course only 1 device is sending commands to the drone, the other is only listening to the broadcast (RX of the drone is disconnected). I put the link here if it can help someone in the same situation as me https://github.com/JulV94/Onboard-SDK

@pavankumarbn
Copy link

pavankumarbn commented May 1, 2018

Hello,

I have been trying to connect Matrice 100 to onboard Intel NUC. Using 3.6 SDK Version but facing following error. Can you please give any suggestions how to fix this issue?

I directly wired TTL end of USB-TTL to UART CAN 2' end. Is it a right way to connect these two? Is there any other way to connect.

Your suggestions will help me a lot to fix this issue.

Read App ID
User Configuration read successfully.

STATUS/1 @ init, L55: Attempting to open device /dev/ttyUSB0 with baudrate 230400...

STATUS/1 @ init, L65: ...Serial started successfully.

ERRORLOG/1 @ getDroneVersion, L1339: Drone version not obtained! Please do not proceed.
Possible reasons:
Serial port connection:
* SDK is not enabled, please check DJI Assistant2 -> SDK -> [v] Enable API Control.
* Baudrate is not correct, please double-check from DJI Assistant2 -> SDK -> baudrate.
* TX and RX pins are inverted.
* Serial port is occupied by another program.
* Permission required. Please do 'sudo usermod -a -G dialout $USER' (you do not need to replace $USER with your username). Then logout and login again

ERRORLOG/1 @ activate, L1228: Unable to initialize some vehicle components!
STATUS/1 @ getErrorCodeMessage, L644: initVehicle
STATUS/1 @ getCommonErrorCodeMessage, L710: ACK_NO_RESPONSE_ERROR
Vehicle not initialized, exiting.

matrice-onboard
screen_shot1

@imkhairulikhwan
Copy link

Hi,

you might want to try to switch the cable's connection as I faced similar issue before:

#292

Hope it helps.

@pavankumarbn
Copy link

pavankumarbn commented May 2, 2018

@imkhairulikhwan Thank you very much:) It is working now.

@imkhairulikhwan
Copy link

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants