Raspberry Pi Troubles

Post here to get support
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

humblehacker wrote:I tried running chmod, but it doesn't look like the script was made executable. I can't figure out if I didn't execute it properly or if the script just isn't compiling. What exactly is the recommended method for adding the /root/bin/cfheadless file? Do you use Leafpad? Geany? IDLE?
Er... /root/bin/cfheadless is just a shell script (Linux' version of a batch file), nothing to compile there. I just hacked it down in vi and made it executable, that's it.
When I try to start the client from command line this is the output I get- [...]
It tries connecting to your copter using radio://0/120/1M. Did you change your copter's bandwith to 1M? It get's shipped with 250K which is why the guide in the wiki explicitely mentiones to change the radio uri in ./lib/cfheadless.py.
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
humblehacker
Member
Posts: 34
Joined: Thu May 16, 2013 7:42 pm

Re: Raspberry Pi Troubles

Post by humblehacker »

It get's shipped with 250K which is why the guide in the wiki explicitely mentiones to change the radio uri in ./lib/cfheadless.py.
I have no idea how the bandwidth settings were changed to 1M... I purposely didn't change anything because I planned on using a PS3 Controller with the default configuration. I'll try it on Ubuntu again and see what the bandwidth settings are on that. Is it possible they were changed when connected to the Ubuntu GUI? I didn't do anything other than set-up but I'll check anyway.
So yes, I read the wiki for about 3 hours yesterday and despite its "explicitly" worded language I am still confused as to whether I need to change anything if I'm not planning to use a custom configuration.
if you want to use a custom configuration for the controller of your choice copy it to ~/crazyflie-pc-client/conf/input. Then edit the file ~/crazyflie-pc-client/lib/cfheadless.py. You'll need to change the URI of your Crazyradio and – if you want a different one than PS3_Mode_1 – configure the correct input mapping to use. The corresponding lines can be found at the end of the file:
If these changes are mandatory then the use of "If you want" is probably misleading, since I had no intention of using a custom configuration.
skube
Member
Posts: 55
Joined: Fri May 03, 2013 2:41 pm
Location: Toronto, Canada

Re: Raspberry Pi Troubles

Post by skube »

You're right, it is a little confusing. I've updated the wiki to hopefully make it more clear.
Crazyflie Nano 10-DOF | AR Drone v1 | MikroKopter Okto
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

humblehacker wrote:
if you want to use a custom configuration for the controller of your choice copy it to ~/crazyflie-pc-client/conf/input. Then edit the file ~/crazyflie-pc-client/lib/cfheadless.py. You'll need to change the URI of your Crazyradio and – if you want a different one than PS3_Mode_1 – configure the correct input mapping to use. The corresponding lines can be found at the end of the file:
If these changes are mandatory then the use of "If you want" is probably misleading, since I had no intention of using a custom configuration.
It just occurred to me how this could be misunderstood... The "if you want to part" only prefixed the changes you needed for the custom input configuration, with the radio uri changed sandwhiched in between. Ah well, skube fixed it in the the Wiki.

Changing that URI, is it now possible to connect?
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
skube
Member
Posts: 55
Joined: Fri May 03, 2013 2:41 pm
Location: Toronto, Canada

Re: Raspberry Pi Troubles

Post by skube »

I've managed to fly with my Pi but I still haven't been able to get the auto connect (udev) stuff working for the CF client. It auto connects the controller fine now, just not the client for some reason. I can fly if I manually execute the cfheadless client from a command prompt. Is there any way to debug this? :?:

When I run ''lsusb'' I get the following output:

Code: Select all

skube@debian:~$ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 046: ID 1915:7777 Nordic Semiconductor ASA 
Bus 001 Device 044: ID 045e:0719 Microsoft Corp. Xbox 360 Wireless Adapter
Crazyflie Nano 10-DOF | AR Drone v1 | MikroKopter Okto
humblehacker
Member
Posts: 34
Joined: Thu May 16, 2013 7:42 pm

Re: Raspberry Pi Troubles

Post by humblehacker »

Has anybody tried the etc/init.d/ method (http://www.stuffaboutcode.com/2012/06/r ... rt-up.html) for starting RPi programs at boot?
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

humblehacker wrote:Has anybody tried the etc/init.d/ method (http://www.stuffaboutcode.com/2012/06/r ... rt-up.html) for starting RPi programs at boot?
The problem with this method would be that if you forget to connect your dongle on startup, or if e.g. the CF loses connection somehow you'd have to reboot the whole Pi just to (re-)gain connection instead of replugging the USB dongle, since the headless client cannot recover (yet?) from connection loss and needs a connection during startup.
skube wrote:I've managed to fly with my Pi but I still haven't been able to get the auto connect (udev) stuff working for the CF client. It auto connects the controller fine now, just not the client for some reason. I can fly if I manually execute the cfheadless client from a command prompt. Is there any way to debug this? :?:
Does it work if you manually execute the /root/bin/cfheadless script with "start" as parameter, e.g. "/root/bin/cfheadless start"? Do you have any errors in /var/log/syslog when performing a "/etc/init.d/udev restart"?
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
skube
Member
Posts: 55
Joined: Fri May 03, 2013 2:41 pm
Location: Toronto, Canada

Re: Raspberry Pi Troubles

Post by skube »

foosel wrote:Does it work if you manually execute the /root/bin/cfheadless script with "start" as parameter, e.g. "/root/bin/cfheadless start"?
Actually, it says command not found, here is the contents of my cfheadless along with the result of "cfheadless start":

Code: Select all

root@debian:~/bin# ls -la
total 16
drwxr-xr-x 2 root root 4096 May 17 17:38 .
drwx------ 5 root root 4096 May 12 15:37 ..
-rwxr-xr-x 1 root root  359 May 17 16:52 cfheadless
-rwxr-xr-x 1 root root  103 May 17 17:24 xbox360
root@debian:~/bin# more cfheadless 
#!/bin/sh
if test "$ACTION" = "add"
then
        /usr/bin/sudo -u pi /home/skube/crazyflie-pc-client/bin/cfheadless > /tmp/cfheadless.log 2>&1 &
        echo $! > /tmp/cfheadless.pid
else
        killall -9 cfheadless
        if test -f /tmp/cfheadless.pid
        then
                PID=`cat /tmp/cfheadless.pid`
                kill -9 $PID
        fi
fi
root@debian:~/bin# cfheadless start
-su: cfheadless: command not found
root@debian:~/bin# 
foosel wrote:Do you have any errors in /var/log/syslog when performing a "/etc/init.d/udev restart"?
Similar thing happens when running "udev restart":

Code: Select all

root@debian:~# cd /etc/init.d/
root@debian:/etc/init.d# udev restart
-su: udev: command not found
root@debian:/etc/init.d# 
Crazyflie Nano 10-DOF | AR Drone v1 | MikroKopter Okto
foosel
Expert
Posts: 175
Joined: Sat Feb 02, 2013 9:59 pm
Location: Obertshausen, Germany
Contact:

Re: Raspberry Pi Troubles

Post by foosel »

In both cases you actually need to prefix either a ./ (if you are already in the folder containing the initscript/the cfheadless script) or need to attach the whole path (since both executables aren't on your PATH and therefore Raspbian won't have a clue what you talking about). Please try again with "/etc/init.d/udev restart" and "/root/bin/cfheadless start".
Image
Also: AR.Drone 2.0 (RC-enabled thanks to self-soldered MiruMod) and Hubsan X4 H107
skube
Member
Posts: 55
Joined: Fri May 03, 2013 2:41 pm
Location: Toronto, Canada

Re: Raspberry Pi Troubles

Post by skube »

Clearly I'm not understanding something fundamental here :oops: I always thought one did a command followed by a path - this appears the other way around :?: I thought I was already in the directory of each executable making the PATH unnecessary.

In any case, I've redone the commands:

Code: Select all

root@debian:~# /etc/init.d/udev restart
[ ok ] Stopping the hotplug events dispatcher: udevd.
[ ok ] Starting the hotplug events dispatcher: udevd.
root@debian:~# /root/bin/cfheadless start
Killed
root@debian:~#
Crazyflie Nano 10-DOF | AR Drone v1 | MikroKopter Okto
Post Reply