0

i tried to launch the sdk package by typing

roslaunch dji_sdk sdk.launch

however every time i get this error:

... logging to /home/dji/.ros/log/b31d5e94-fec0-11e9-9835-74da38ebc18f/roslaunch-manifold2-18825.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://manifold2:41911/

SUMMARY

PARAMETERS

/dji_sdk/align_time: False
/dji_sdk/app_id: 1079440
/dji_sdk/app_version: 1
/dji_sdk/baud_rate: 921600
/dji_sdk/enc_key: 39d353a8e9ad01b6c...
/dji_sdk/serial_name: /dev/ttyUSB0
/dji_sdk/use_broadcast: False
/rosdistro: kinetic
/rosversion: 1.12.13
NODES
/
dji_sdk (dji_sdk/dji_sdk_node)

auto-starting new master
process[master]: started with pid [18835]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to b31d5e94-fec0-11e9-9835-74da38ebc18f
process[rosout-1]: started with pid [18848]
started core service [/rosout]
process[dji_sdk-2]: started with pid [18856]

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

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

ERRORLOG/1 @ getDroneVersion, L1503: 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, L1387: Unable to initialize some vehicle components![ERROR] [1572843926.785053218]: drone activation error
[ERROR] [1572843926.785190956]: Vehicle initialization failed
^C[dji_sdk-2] killing on exit
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

here is the steps that i followed to activate the drone:

source devel/setup.bash
catkin_make
rosed dji_sdk sdk.launch

where i edit the baud rate/app id/ enc key/ and serial name.

app_id: 1079440 baud_rate: 921600 serial_name: /dev/ttyUSB0 enc_key: 39d353a8e9ad01b6c659111904bae57ebb138785aa5159699383f28da3f56563

and i continued with the following commands:

roslaunch dji_sdk sdk.launch

its where i got the error.

i'm using USB-TTL cable to connect manifold 2-c with M210 RTK V2, also i got the permission first before typing any code by typing :

usermod -a -G dialout $USER

and then log out and log in then i typed :

sudo chmod 666 /dev/ttyUSB0

to read and give permission to serial port.

TX (green wire) and Rx (white wire) and ground (black wire) there were put respectively.

so now what should i do?

  • I am not exhaustively familiar with this library, but according [to this issue](https://github.com/dji-sdk/Onboard-SDK-ROS/issues/98), other people have had the same problem. You might need to upgrade firmware? In anycase, you might find the answer, or at least better support, on that github. – JWCS Nov 05 '19 at 16:39

2 Answers2

0
  1. Some USB-TTL cable doesn't support 921600 baudrate,I suggest you using FT232R USB-TTL cable
  2. You need to enable SDK in the DJI Assistant 2 and set the drone buadrate 921600 enter image description here
Macaldan
  • 109
  • 3
0

There are too many possibility Please refer my previous answers and check them one by one

DJI A3 Onboard SDK problem (No connection)

Information you have given is not enough, there could be many possibilities. Please go through with the following checklist (this is what first comes to my mind, if I remember sth new, I`ll add it in)

The list is meant for error such as Drone version not obtained or new device error or first success connection(get firmware) then failed activation for Both DJI OSDK and DJI OSDK-ROS. Assuming you already enabled the API control, then check

  1. Does UART on RPI is enabled? if not, enable it. Are you using the correct serial ID as well? If not, set it right. Recommend using /dev/serial/by-id/usb-XXX method

  2. Does Baud rate in DJI assisatnt2 is same as the one in the USERCONFIG file of OSDK? if not, make it same

  3. Did u give permission to the serial device e.g sudo chmod a+rw or sudo usermod -a -G dialout $USER or set the udev rule . If not choose a way to get it right.

  4. FTDI series problems

    4.1 Did you use this FTDI cable successfully on other platform before?(to make sure tx rx is correct)

    4.2 Is this FTDI 3.3V? If not, high chance your FCU board is already burned. Send it back for repair.

    4.3 Measure the voltage on Tx and RX pin while everything is connected, is it being pulled up at 3.3V? if less than 3 then there is a serious communication issue.

    4.4 Is there EMI generator around?( this one happen to me once, took me 2 weeks to isolate the issue, EMI cause unreliable connection)

    4.5 As an additional test, prob the tx and tx by Y cable using real-term to see if you can see any proper communication happening.

  5. Did u forget to turn on the RC ? If so turn it on while calling the sdk.launch

  6. GO app side issue

    6.1 Did u connect the Go app while running sdk.launch? If not connect by GO app, connect it as it will pop up sth.

    6.2 Did you login to your account which creates the app id?If not, login to it.

    6.3 And is your account being banned for flying in the non-authorized area before(e.g caught by DJI aeroscope/Flyhub) and police is actually going after you? If so, stop playing the drone and surrender urself in. Normally it should be max of one year Jail time, but if you resist, the punishment can be more deadly.

  7. Did u give authority from GO app? click ok or confirm on the GO App once you run sdk.launch in the RPI. Once you launch the sdk, the Go app will pop up sth, Did u do/experience it? After changing the firmware, you should experience this again.

  8. Did u tried the hardware with the 3.8 with a Normal X86/X64 Intel PC/notebook with Ubuntu 16/18 before? is it working? ( rule out hardware / connection issue ) If can work, then its RPI issue. If can not, high chance drone/RC side. I do have couple RPI burn down experience b4.

  9. Did u have valid/correct app id and enc key? double check it. If not, enter is correct.

  10. Is the voltage supplied to A3 stable and clean?

  11. Have you tried this way of calling? /the_sample_u_wish_to_run UserConfig.txt /dev/ttyACM0 (this is what I gathered from other peoples experience)

  12. Which version of RPI you are using, if you are using 2 series, the high chance you have to use https://github.com/dji-sdk/Onboard-SDK/tree/raspberrypi-support with older version firmware. I only tested with RPI 3B. Can not guarantee the function of other versions. That's why number 8 is important to isolate the issue.

  13. Are you calling the sdk.launch from somewhere else? make sure you only call it once and prevent it from being calling again. Make sure the serial port is not occupied.

  14. Make sure API is enabled in DJI assistant2. Close everything power on and connect to DJI assistant 2 again to verify this. If by any chance the board has an issue, the API enable you set in the previous run will get auto deselected. This is to rule out burned FCU board issue.

  15. If by now it is still can not work, then you should try other 3.8 or 3.7 with firmware 1.7.7 and 1.7.5 or whatever firmware you can access. as far as I know, their delay+ wait for ACK always have all sorts of issues. Maybe adding more delay in the wait for serial ack will help you(solution from other github dji_osdk post)

  16. In case of this particular A3 burned, swap another fresh open A3 and proven working FTDI cable(test with Arduino) to rule out the A3 problem

If still no luck, file a ticket to dev@dji.com + send a complaint to Samuel@DJI. Send them the long list of thing you tested, and if they say high chance it is a hardware issue. Do send it back for RMA. I do have experience of one Normal A3 and one M600 A3 has burned FCU board issue before.

After this, if you encounter can not fly GPS mission by OSDK or can not do local flight control. Just try different firmware version. DJI firmware release is usually very buggy for developer.

edit

For you case, use windows. as i have no issue with windows based method Make sure the slider to the right with my image view. I have no MAC so cant test MAC solution.

YOu might need to plug in and un plug and plug in for couple time

by default api is disabled. so you have to enable it and select the hz rate for topic you wish to receive. Good Luck. This is all I can do.

enter image description here

Community
  • 1
  • 1
Dr Yuan Shenghai
  • 1,849
  • 1
  • 6
  • 19
  • 1- I'm not using RPI, as for the serial name /dev/ttyUSB0. 2- I think that the baud rate is not the same as 921600, dji assistant 2 opened once and i saw that it was 230400 but not i does not connect to my MacBook pro. 3- i gave the permission and log out and log in again as it was suggested in the website. 4- FTDI cable how can i know the voltage ?. 5- RC is on. – Ibtesam ali Nov 10 '19 at 04:37
  • 11- i don't get what you mean by this. 12- i'm not using RPI, instead i'm using ROS. 13- How can i know if the package is not occupied or called from somewhere else?? – Ibtesam ali Nov 10 '19 at 04:50
  • RPI is just in case. Dont hang on to it. I do most use pc with ROS also. not the same as 921600 is fine. as long as dji assistant 2 and your launch file agree with each other. If you have problem with assistant2 try a windows PC. You must! enable API control and set the same baudrate in the assitant 2 before proceed – Dr Yuan Shenghai Nov 11 '19 at 05:14
  • w8 for M210 you have to slide the slider on the drone so that to enable dji asstant 2. I had trouble there also. For M210 v2, it has the same 3 way slider – Dr Yuan Shenghai Nov 11 '19 at 05:21
  • see https://developer.dji.com/onboard-sdk/documentation/M210-Docs/aircraft-checklist.html . I only used v1 yet. v2 haven`t have. V1 i had problem with connecting to dji assitant2. there is a 3 way slider between the circle and external power. it only works with dji assitant with one of the way. V2. i think you have to slide a similar thing also. – Dr Yuan Shenghai Nov 12 '19 at 04:22
  • I tried it both ways to make sure, but still dji assistant 2 doesn't connect. – Ibtesam ali Nov 17 '19 at 04:07
  • just to check with you. your assistant 2 is for matrics right. Dont use original assitant 2 but the one for matric. if still can not, then try with a windows pc with the proper dji driver installed. if still can not, contact dji support with list of thing you tried. then high chance they will ask you to send back for repair – Dr Yuan Shenghai Nov 17 '19 at 19:32
  • I opened Assistant 2 using adaptor, i changed the baud rate and enabled the API, but i get a new device error – Ibtesam ali Nov 26 '19 at 04:39
  • go app or pilot app will pop up an warning asking enable api ? just click yes. If app not pop up. run da2 concurrently with sdk. keep da2 on or app on, then sdk.launch – Dr Yuan Shenghai Nov 26 '19 at 12:25
  • what is run da2 concurrently with sdk. keep da2 on or app on, then sdk.launch??? – Ibtesam ali Nov 27 '19 at 05:06
  • actually API is enabled – Ibtesam ali Nov 27 '19 at 05:09
  • i know api is enabled. but stupid dji design they will ask you again with a pop up window and this new verion has some issue, come time it will not pop up. So you need 2 pc. I feel it difficult to tell you how to do. – Dr Yuan Shenghai Nov 27 '19 at 09:55
  • bro i officially give up on you. My instruction is much more clear than what DJI gives me. If you want i can at most send you screen shot of me and DJI chat. – Dr Yuan Shenghai Nov 27 '19 at 10:01
  • It did pop up and i activate it, you do so. – Ibtesam ali Nov 28 '19 at 06:23