DJI A3 Onboard SDK problem (No connection) - dji-sdk

I have a DJI S900 with A3 controller. I established the API connection between the Raspberry Pi and the drone. Until last week everything has been perfect, but now, I am taking the error shown below (I am running the telemetry example).
There is no problem related to the serial cable and Raspberry Pi. Also, SDK is enabled, and API settings are correct. I reset the controller and upgraded it. However, I have the same error. Also, I tried many times turning everything off and back on again before upgrading the controller.
A3 firmware = V1.7.7.0,
OSDK = 3.8.1,
Raspberry Pi operating system = Rasbian,
Lightbridge 2 = 1.1.40
Read App ID
User Configuration read successfully.
STATUS/1 # init, L55: Attempting to open device /dev/serial0 with
baudrate 230400...
STATUS/1 # init, L65: ...Serial started successfully.
ERRORLOG/1 # getDroneVersion, L1418: 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, L1302: Unable to initialize some vehicle
components!
STATUS/1 # getErrorCodeMessage, L656: initVehicle
STATUS/1 # getCommonErrorCodeMessage, L722: ACK_NO_RESPONSE_ERROR
Vehicle not initialized, exiting.

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
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
Does Baud rate in DJI assisatnt2 is same as the one in the USERCONFIG file of OSDK? if not, make it same
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.
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.
Did u forget to turn on the RC ? If so turn it on while calling the sdk.launch
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.
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.
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.
Did u have valid/correct app id and enc key? double check it. If not, enter is correct.
Is the voltage supplied to A3 stable and clean?
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)
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.
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.
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.
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)
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
Edit
17. If you are using m210 v2, the activation pop up will not shown on pilot app. Run the dji assistant 2 first and then call the sdk.launch twice.
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.

Related

OSDK4.x: Can you use DJI Assistant 2 for Matrice with payload actions?

Is it possible with OSDK4.x to command payload and flight actions and use the DJI Assistant 2 for Matrice concurrently?
Previously, we have been using the M210V1 with OSDK3.9. Using the DJI Assistant 2 for Matrice to simulate the drone flight is key to our ability to develop our system.
However, the M210V2 and OSDK4.x require the USB port of the drone to be connected to the Linux device running the OSDK, otherwise any payload (GimbalManager, CameraManager) actions throw an error - such as GimbalManager::resetSync.
This is not ideal for development since we cannot use the simulator (on MacOS) and connect the USB to the Linux device (there is only one USB port on the drone). Has anyone solved this problem?
Yes and no.
For 210, There is only one USB2 port and it is either for connecting to PC side assitant2 or connecting to onboard PC to get osdk stream. You can think it as a bug in design phases.
Yes, you can run part of osdk and run the simulator without the payload camera-related function. If I recall correctly, I can still "rostopic echo" the Gimbal orientation topic from the drone. Its only image topic that is disabled. You can simulate the GPS based flight in simulator and try to set gimbal direction. I remember this was achievable.
There is no way for you to run both simulators and get payload functions such as images from OSDK. so to get both image running and drone running in simulator that's not achievable.
If you really wants both at same time. I suggest you move to M300 which they have dual USB C interface for both camera stream and for simulation.

M300 OSDK - drone version not obtained

Since I cannot get the manifold 2 in my region, I created a cable according to https://forum.dji.com/forum.php?mod=viewthread&tid=219723.
The cable is connected via FTDI converter directly to the drone's OSDK port.
when connected to a serial terminal application I get data from the drone
Terminal
When I try to debug the flightcontrol-sample in Linux, I get the following:
LinuxOutput
Data is also received in Linux using 'screen' command.
testing the cable for 'loopback' works fine.
I have changed the port baud rate to several options (230400 & 921600) to no avail.
the ACM cable is connected through an additional USB port to the drone's port directly.
Am I missing some HW components in my setup?
I have entered all the relevant Linux commands to get the required permissions as advised in
https://developer.dji.com/onboard-sdk/documentation/quickstart/development-environment.html
&
https://developer.dji.com/onboard-sdk/documentation/quickstart/run-the-sample.html
Am I missing something in that department?
The final goal is to use STM32 as FC, but testing is easier using the Linux environment.
Any additional things I can test?
Are there other working setup designs I can try?
Thanks for your help.
i got M300 osdk connection up at Apr 2020.
So far not many issues. There are many tricks and rules that you need to follows e.g osdk adapter board usb type C seam side face inside. make sure osdk adapter board is powered up by checking the output supply voltage. 3.3V FTDI. and make sure it is pull up properly by checking voltage as well
After you check through the hardware.
the software has many tricks as well. for M300 only osdk/osdkros 4.0 and above can drive. The new userconfig.txt format changed and you have to change accordingly. and you can go through my checklist which I posted on DJI forum https://forum.dji.com/forum.php?mod=viewthread&tid=216529
If you really still have a problem. do provide photos on your connection, the terminal output for the error message.
As Dr. Yuan suggested, have a look at the UserConfig.txt file. Depending on which OSDK version you are using, it has a different format.
In my case, using osdk 3.9 configuring it this way solved my issues:
app_id : xxx (number)
app_key : xxx (number)
device : /dev/ttyUSB0
baudrate : 230400
Also check your FTDI cable, it once burned out for me and it was the reason for this error too. You should try a new one just in case.
I use the OSDK with a raspberry pi, in case you are using this kind of linux environment, I suggest you check the configuration files (cmdline.txt and config.txt) doing sudo nano /boot/cmdline.txt and same for config.txt.
my configuration for cmdline.txt is:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
And for config.txt just add this at the end:
enable_uart=1
init_uart_clock=64000000
start_x=1
I hope these can help and that I am not too late.

How to acquire DJI Onboard SDK control permission without remote control (or turned off remote control)

I'm planning to make automatic landing and battery charging system based on DJI M100 and Onboard SDK. It should work for long period (months) autonomously.
The problem is I can't get Onboard SDK control permission without remote controller turned on and mode is switched to "F".
Is it possible to set up DJI M100 drone to get control from Onboard SDK after power on without remote controller connected?
I tested with N3 with firmware before July 2017. It does allow you to arm or disarms the drone directly through the OSDK (3.2 if i remember correctly). Whether it is a public firmware or DJI supplier only firmware, that I dont know. I didn`t touch on the hardware and gain. Just Implementing software navigation module
I accidentally run the software b4 turning on the lightbridge2. The result is I almost killed myself.

Remote Power Reset (RPM) on EVM doesnt work

We have CI set up and very often our EVM boards (DSP boards) goes into a wrong state (reason unknown!!)and USB emulation was failing; to over come the issue we used to power reset the EVM board and everything used to work fine;
Now we have started using RPM (Remote Power Management) utility using which we can remotely reset the power on the device but unfortunately this doesnt seems to be working fine!!
We are able to reset the power on the EVM Board but we are unable to bring back the EVM board to working condition we are still getting USB emulation failure!!
Any thoughts on this; BTW we tried mulitple times resetting the power on EVM board using RPM but still same issue
Appreciate your help in this regard.
Raju

How to send modem AT Commands to a board from from OSX

Does anyone out there who has developed on a dev board attached to a Mac OSX machine's USB port know how to send AT tty modem commands to the board? Arduino folks? Anyone?
TL;DR
I purchased a development STEVAL-SPBT2ATV2 "USB Dongle for the Bluetooth class 2 SPBT2532C2.AT module", which, according to the docs and spec has "downloaded FW, enabling the user to create a Bluetooth link with simple AT commands."
Which would be great, except all the documentation is only for old MS Windows, and doesn't give any hints on how to program this device from OSX or Linux.
Do I need to install a driver of some sort? Everything I've tried is like talking to a brick wall: I send commands, but nothing comes back from the board.
Things I've tried:
/dev/tty.Bluetooth-Modem already existed. Didn't seem to do anything. I think that's the built-in bluetooth device.
/dev/tty.AmpedUp-AMP-SPP and /dev/cu.AmpedUp-AMP-SPP showed up when I went to "Network -> set up bluetooth device" - which is good (correct device name) but strange, why under network?
Then under Bluetooth I can add a "serial port used to connect to this computer" and get the choice of Modem or RS-232. I guessed Modem.
I really hope I don't have to mess with the /etc/tty files
Nothing. the device never seems to react, or send any data back. I've tried several ways to send data to the device. Silence.
echo "AT+AB GPIOConfig 2 O^M" > /dev/cu.AmpedUp-AMP-SPP # ctrl-v ctrl-m for the ^M
screen /dev/tty.AmpedUp-AMP-SPP
cat /dev/tty.AmpedUp-AMP-SPP
minicom # via brew
chat /dev/cu.AmpedUp-AMP-SPP
From the docs:
Each dongle has the following factory default:
UART: 115200 baud, no parity,1 stop bit,8 data bits
Local name: “Amp'ed UP!’
Class of device: Misc Device
Profile: SPP (serial port profile)
Service name: “AMP-SPP”
Deep sleep: disabled
Page and inquiry scan: 1.28s interval, 11 ms duration
Security: disabled
Bonding PIN: “1234”
Bonding allowed: always enabled
I figured out where I was wayyy off-base with some help from a friend.
I thought that I was trying to establish a OSX->Terminal->Serial (Over USB)->Chip communication channel to program the chip.
When in reality, I was trying to establish a OSX->Terminal->Serial (over Bluetooth->Bluetooth) -> Chip channel to talk to the chip using the existing firmware, which includes enough defaults to have 4 GPIO/LED outputs. The USB only comes in later if I want to change the firmware.
Which means plugging the board into my laptop's USB port isn't necessary and only complicates the issue - better is plugging it into a spare USB charger next to my laptop.
... Which let me narrow down the problem to 2 things:
OSX isn't holding an open bluetooth communication channel to the BT device, so of course I won't be able to talk to it, even if the serial port is set up right
Even if I could talk to it, Apple iOS is so locked down that I won't be able to connect to it from an iPhone/iPad. :(

Resources