LPS node failed to set dtr/rts

Firmware/software/electronics/mechanics
Post Reply
SlouchyCat
Member
Posts: 30
Joined: Mon Oct 10, 2016 3:56 am

LPS node failed to set dtr/rts

Post by SlouchyCat »

Dear crazyflier,
I am unable to connect to one of my LPS node and when I "dmesg", i saw this "failed to set dtr/rts" problem and i am unable to access to this node. The error is shown below:

picocom v1.7

port is : /dev/ttyACM0
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv
imap is :
omap is :
emap is : crcrlf,delbs,
FATAL: cannot open /dev/ttyACM0: Device or resource busy


Please help!

SlouchyCat
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS node failed to set dtr/rts

Post by arnaud »

Hi,

What is the version of the firmware you are running in the anchors? There has been a lot of work on the USB last week so maybe you could try the dev-tdoa branch. I still have a bug to fix on this branch before merging it on Master but the USB part is working really well on it.

/Arnaud
SlouchyCat
Member
Posts: 30
Joined: Mon Oct 10, 2016 3:56 am

Re: LPS node failed to set dtr/rts

Post by SlouchyCat »

Hi arnaud,
Thanks for the reply!
I am using lps-node-firmware from dev-freertos branch and just synced with the latest TWR tag algorithm, other anchors are okay. Its just one of them has this problem. I cannot find the dev-tdoa branch under lps-node-firmware, may i know where can I find this branch?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: LPS node failed to set dtr/rts

Post by arnaud »

Hi,
Sorry I meant dev-freertos. I am working on tdoa but it is not working yet though. I just merged dev-freertos to master so master now contains the new USB implementations.

- Have you ever been able to connect the problematic node?
- Is it possible to program it with DFU?

/Arnaud
SlouchyCat
Member
Posts: 30
Joined: Mon Oct 10, 2016 3:56 am

Re: LPS node failed to set dtr/rts

Post by SlouchyCat »

Hi arnaud,

Yes I was able to connect to the problematic node before, and yes it is possible to flash it with DFU. However, same problem occurs even after I flashed the latest firmware ( the merged master firmware). When I try to "picocom /dev/ttyACM0", the following msg is shown:
tl@tl-desktop:~$ picocom /dev/ttyACM0
picocom v1.7

port is : /dev/ttyACM0
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv
imap is :
omap is :
emap is : crcrlf,delbs,

Terminal ready[/i]

I am still unable to access to the node setup. Please advise!

Thank you!
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: LPS node failed to set dtr/rts

Post by marcus »

Hi,

If the node is reset or crashes you might see something line this (got this while resetting it a few times).

Code: Select all

[ 8241.037789] cdc_acm 2-2:1.0: ttyACM3: USB ACM device
[ 8244.865185] usb 2-2: USB disconnect, device number 63
[ 8244.865268] cdc_acm 2-2:1.0: failed to set dtr/rts
[ 8247.449871] usb 2-2: new full-speed USB device number 65 using xhci_hcd
So if I understood correctly the other nodes work with the same firmware, but this one never prints the "hello" message. What happens if you press 'h' on the keyboard after connecting? This should print a help message.

Code: Select all

-------------------
0-9 - set address
a   - anchor mode
t   - tag mode
s   - sniffer mode
d   - reset configuration
h   - This help
Linux will first try to open the device and send modem commands to it, this takes about 10-15 seconds. During this time you will the the message you pasted in the first post:

Code: Select all

FATAL: cannot open /dev/ttyACM0: Device or resource busy
Could you wait about 30 seconds (to be sure) before trying to connect to it the first time and check if you get the message. If you don't try to connect once more and see if you get it.
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: LPS node failed to set dtr/rts

Post by marcus »

One more thing. When Linux tries to check if the device is a modem it will send commands to it. Unfortunately some of these contain 1 and 0, which will reset the anchor address (I think the final state is 0). To make things easier you could disable this so you keep the correct anchor address and can open the device directly after connecting it. If you're running Ubuntu you can switch or the modem manager with the following command (until the next restart).

Code: Select all

systemctl stop ModemManager.service
You could also disable it completely using the following command (won't start the modem manager on reboot):

Code: Select all

systemctl disable ModemManager.service
Note that if you're using the modem manager (like for a 4G mobile modem) you probably can't use this workaround.
SlouchyCat
Member
Posts: 30
Joined: Mon Oct 10, 2016 3:56 am

Re: LPS node failed to set dtr/rts

Post by SlouchyCat »

Hi marcus,
Thank you for the help. Unfortunately I am still getting the error message "failed to set dtr/rts" after waited for 2 mins. Disabling modem manager seems no effect to the node. When I press h also no response from console and the terminal is ready

Code: Select all

[ 2000.303502] usb 2-4: USB disconnect, device number 10
[ 2000.303678] cdc_acm 2-4:1.0: failed to set dtr/rts
[ 2003.937601] usb 2-4: new full-speed USB device number 11 using xhci_hcd
[ 2004.066954] usb 2-4: New USB device found, idVendor=0483, idProduct=5740
[ 2004.066956] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2004.066957] usb 2-4: Product: Loco Positioning Node
[ 2004.066958] usb 2-4: Manufacturer: Bitcraze AB
[ 2004.066959] usb 2-4: SerialNumber: 1F0049000451485732303920
[ 2004.067380] cdc_acm 2-4:1.0: ttyACM0: USB ACM device

Code: Select all

$ picocom /dev/ttyACM0
picocom v1.7

port is        : /dev/ttyACM0
flowcontrol    : none
baudrate is    : 9600
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,

Terminal ready
Do you have other solutions in mind?
Thank you!
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: LPS node failed to set dtr/rts

Post by marcus »

Since the DFU is working and the log from production shows output from the UART I think it's a firmware issue. It might be something wrong in the EEPROM, do you have the toolchain set up? If so then do one build where you call this function to write a default configuration to the EEPROM?
Post Reply