Why can't youbot_battery_monitor connect to serial port?
Hi,
i am trying to get youbotbatterymonitor running on my youbot. The README (cannot post link, please check yourself on google) says i could run youbotbatterymonitor as standalone program. But when i try to run it with
$ ./home/youbotuser/Software/catkinws/devel/lib/youbotbatterymonitor/youbotbatterymonitor /dev/youbot/lcddisplay eth1 wlan0 &
it says "could not to connect to serial port: /dev/youbot/lcd_display"
I wrote a udev rule 110-battery.rule:
SUBSYSTEM=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="059d", SYMLINK+="youbot/lcddisplay", RUN+="/home/youbotuser/Software/catkinws/src/youbotdiagnostics/youbotbatterymonitor/youbotbattery_monitor.sh"
My youbotbatterymonitor.sh looks like this:
#!/bin/bash
export ROSMASTERURI=http: //localhost:11311
/home/youbotuser/Software/catkinws/devel/lib/youbotbatterymonitor/youbotbatterymonitor /dev/youbot/lcddisplay eth1 wlan0 &
The udev rule seems to be working. It at least generates the /dev/youbot/lcd_display file. But i am not really sure about using SUBSYSTEM=="usb"?!
I don't use the youbot that long yet. I'd really much appreciate any help. Thanks a lot.
Edited after ahendrix 2nd comment:
I think i finally solved the problem why it cannot connect to the serial port. But it is still not running properly yet. I can execute youbotbatterymonitor.sh by typing "sudo bash youbotbatterymonitor.sh". I obviously needed the root rights i got by adding sudo.
This is the output i get then:
sudo bash youbotbatterymonitor.sh
youbotuser@Jakobs-youBot:~/Software/catkinws/src/youbotdiagnostics/youbotbatterymonitor$ try to connect to serial port: /dev/youbot/lcd_display
serial port /dev/youbot/lcd_displayis already open
connected to serial port: /dev/youbot/lcd_display
[W ]
[L ]
[W ]
[L ] ....
Every time it prints [W ] and [L ] it is beeping.
Asked by m.hoev on 2014-05-19 03:45:34 UTC
Comments
Are the permissions on /dev/youbot/lcd_display correct? It looks like that udev rule should already be starting the battery monitor; perhaps you should check to see if it's already running?
Asked by ahendrix on 2014-05-19 05:11:16 UTC
the lcd_display file has these permissions: lrwxrwxrwx 1 root root The udev rule does start youbot_battery_monitor.sh, which starts the exe. The process is running. But it is beeping the whole time and i think it is beeping because it doesn't get a signal because cannot connect to the serial port??
Asked by m.hoev on 2014-05-19 22:17:01 UTC
I suspect the process that's running has a lock on the serial port so that other programs can't open it. I would look for a log from that process to see if and how it's failing, or just kill it and run it again from the terminal, where you can actually see the output.
Asked by ahendrix on 2014-05-19 22:33:31 UTC
Check edited question...
Asked by m.hoev on 2014-05-19 23:11:51 UTC
Solved it. I changed SUBSYSTEM=="usb" to SUBSYSTEM=="tty". This fixed it. Now it is running how it is supposed to do. Tanks a lot for your help.
Asked by m.hoev on 2014-05-20 23:50:20 UTC