Jump to content

Stupid question - self boot?


mrbill
 Share

Recommended Posts

Hi,

 

Stupid question maybe - but having read all the doc online - I can't seem to find the answer..

 

Do the bricks need permanent attachment via USB to a PC?  Or is the pc just used to download code to the brick, after which it will run the code and even after power-down self-boot running this code?

 

Thanks,

 

Link to comment
Share on other sites

As far as I understand it, the PC is used to control the bricks and to run the code that drives the bricks, so the bricks need to have a connection to the pc all the time. If you need code that runs on the bricks itself, you need to write the code in embedded c and flash it to the bricks, but this is not supported right now.

Link to comment
Share on other sites

I'm looking at getting a Beaglebone or Beagleboard to act as the micro-controller.  It looks like you can then use it (if you know linux) to run the code via a usb connection to the master brick.

 

Once I have it, learned some linux, figured out Angstrom on the board and tested out a connection I'll let you know how it goes. :-\

 

There are probably better ways to connect but this looks the simplest as a starter.  Not sure whether there will be issues with timing though - only trial and error will tell.

Link to comment
Share on other sites

Apologies if this is slightly off topic but it does relate to the questions around processor control for the Tinkerforge devices.

 

I am having a nightmare with Beaglebone.  It's got Angstrom installed but won't accept all the necessary drivers needed for the Tinkerforge Daemon right now.  I can install Libusb, I can install 75% of python-twisted packages but python-gudev doesn't install at all.  It seems that getting the packages for Angstrom are very difficult - they are easy to find for Debian and Ubuntu but whether they would currently work for the very new Beaglebone I'm not sure.

 

I tested the installs for Ubuntu on my pc and it was very simple.

 

As it was so easy I therefore tried to move to Ubuntu and Debian on the Beaglebone, however both attempts result in no ability to connect to the device via usb or ethernet.  From some responses it seems that the builds for the bone are alpha so this might be the reason.  I've been working on this constantly for over a week.

 

My conclusion is that the Beaglebone is so new that support is no where near the level the Beagleboards have.  I guess it's a case of waiting for some time to have the bugs ironed out by those who have the expertise to build the kernels, packages etc for the Beaglebone.

 

I'll turn my attention to the Raspberry Pi when it arrives but I suspect it's going to have exactly the same issues with getting these three packages installed. 

 

I wonder whether I should give up on the Python interface and have a look at learning C instead and trying to figure out how to programme the onboard devices.  I suspect this would be a learning curve well beyond me though. 

 

Any simple guidance on how to start low level coding the devices would be a help.  A small example for instance.

Link to comment
Share on other sites

The issue I had with some of the installs was that they failed on not being compatible with the hardware (rather than Angstrom).  They were Arm based just not right for Arm7a I guess. 

 

It seems that RPi is Arm6 so it has a better chance of success.  Fingers crossed.

 

If we have issues with it then maybe Tinkerforge will jump in to investigate.  I can see the RPi being huge so it would make sense for them as it increases the chances of Tinkerforge adoption.  Something I'm keen to see.

 

If I get it hooked up together I'll post my discoveries.

Link to comment
Share on other sites

Hi guys,

 

just some general ideas i have on this topic:

- In principle there is no problem to get our stuff running on arm based embedded devices, in the German forum someone got brickd running on his NSLU (http://en.wikipedia.org/wiki/NSLU2, 133Mhz, 8MB flash). So, all the Beagleboard derivatives and the RPi should definitely work.

 

- Debian on Beaglebone: Coldwilson: Did you not manage to install Debian at all or could you install Debian and our stuff didn't work? Because if you can install Debian it really should work out of the box, since we don't use any platform dependent stuff and Debian has all dependencies (python-twisted, python-gudev and libusb).

 

- Angstrom: I am no Angstrom expert, but i could find libusb, python-twisted and gudev in the repository. I could not find the python bindings for gudev, can you try to install them from source: https://github.com/nzjrs/python-gudev? As far as i can see, it consists of only one c file.

 

- gudev: It is possible to use brickd without gudev! gudev is only needed for the hotplug functionallity. So, if you plug in the Bricks and start brickd afterwards it should work.

 

- Coldwilson: If you have libusb and python-twisted installed on your Beaglebone, could you install the brickd source, change the logging level to logging.DEBUG in brickd/src/brickd/config.py then plug in a Brick, then start the daemon with "python brickd_linux.py nodaemon" as root and post the output of the daemon here? It should say something like "Could not import gudev. Disabling USB hotplug" but work fine otherwise afterwards (if you plugged in the USB devices before you started brickd). If it doesn't work that way i would be interested in the error messages, perhaps it is something i can fix.

 

I have lots of open source arm devices laying around here (beagle boards, openmoko etc, i have no beaglebone, but i intend to buy RPis). But currently i don't have Angstrom on any of them, so unfortunately i can't test it myself right now.

Link to comment
Share on other sites

Wow, thanks for the detailed reply Borg.

 

I'm at work at the moment so will look into this in more detail and reply on my findings.  I am new to Linux so I can follow help scripts provided such as these http://elinux.org/BeagleBoardUbuntu#Demo_Image.  I've done the installs (using the scripts) for both Ubuntu and Debian using these guides but I am unable to connect to the boards by USB or Ethernet after doing the setup.  The guy who's written these (Peter Nelson) has mentioned that the Beaglebone images/kernal are still alpha so that might be the reason.  If I had a Beagleboard I might have got further. So in answer to your question I haven't managed to get a command line up for Debian or Ubuntu to get far enough to do the package installs for the Daemon yet.  It was easy, I got them all, when I did it using Ubuntu on the PC using Aptitude and a hunt around for Python-Gudev which isn't listed in Aptitude.

 

As mentioned, I got further with Angstrom.  It uses OPKG instead of Aptitude (same concept of course).  It's library is far smaller.  It had Libusb but not Python-Twisted or Python-Gudev.  I did a lot of searches and never found a set of files for Twisted, some were version Arm6 and wouldn't install.  I am not familiar with C and some sites don't make it easy for the newcomer to understand their files so maybe, as you suggest, there are files I could have grabbed that weren't so obvious to get it working.

 

Still, your comments have inspired me to try again so I'll revisit my attempts with Angstrom.  I can't make any further progress with Ubuntu or Debian on the Beaglebone as there seem to be too many bugs (at least for someone like me to resolve without better knowledge).

 

Link to comment
Share on other sites

i could find libusb, python-twisted and gudev in the repository. I could not find the python bindings for gudev, can you try to install them from source: https://github.com/nzjrs/python-gudev? As far as i can see, it consists of only one c file.

 

- gudev: It is possible to use brickd without gudev! gudev is only needed for the hotplug functionallity. So, if you plug in the Bricks and start brickd afterwards it should work.

 

I found Gudev but not Python-Gudev for Angstrom.  No idea what the difference is but all I was trying to install was Python-Gudev as I want to program in Python.

 

Thanks for the link, I did stumble on that but I've absolutely no idea what to do with the files as it all looks like C to me.

 

Can you clarify what the hot plug functionality is please?  I would like to plug my Beaglebone's usb port into the usb of your Master Brick and have it run a python program (for a micro mouse) just as if it were a pc connected over a usb cable.  When does the hot plug functionality get used?

 

Cheers

 

 

Link to comment
Share on other sites

Can you clarify what the hot plug functionality is please?  I would like to plug my Beaglebone's usb port into the usb of your Master Brick and have it run a python program (for a micro mouse) just as if it were a pc connected over a usb cable.  When does the hot plug functionality get used?

 

With the hotplug functionality brickd can find newly plugged in Bricks. If you plug in your Bricks first and start brickd afterwards, it will work without gudev (at least it should).

Link to comment
Share on other sites

Ah,

 

I can't install the Brickd software on the Beaglebone as your build are for Debian (.deb).  I don't know how to make that work for Angstrom.

 

Would it be easier if I just used C instead of Python (ignoring the harder coding).  Would that avoid the need for Python-Twisted and Python-Gudev?

Link to comment
Share on other sites

you need python-twisted for the Brick Daemon, this is independent from the programming language you want to use.

 

You can install the Brick Daemon from source (here is a lik to the zip: https://github.com/Tinkerforge/brickd/zipball/master)

Just unzip it somewhere on your beaglebone, go to brickd/src/brickd and start with "python brickd_linux.py nodaemon" as root. As i mentioned before, you can also enable debug output if you install it from source and give me more information this way.

Link to comment
Share on other sites

Here's what I got:

root@beaglebone:~/Tinkerforge-brickd-5afa1c2/src/brickd# python brickd_linux.py nodaemon

Traceback (most recent call last):

  File "brickd_linux.py", line 30, in <module>

    from usb_notifier import USBNotifier

  File "/home/root/Tinkerforge-brickd-5afa1c2/src/brickd/usb_notifier.py", line 25, in <module>

    from libusb import usb1

  File "/home/root/Tinkerforge-brickd-5afa1c2/src/brickd/libusb/usb1.py", line 52, in <module>

    import libusb1

  File "/home/root/Tinkerforge-brickd-5afa1c2/src/brickd/libusb/libusb1.py", line 32, in <module>

    from ctypes import Structure, \

ImportError: No module named ctypes

root@beaglebone:~/Tinkerforge-brickd-5afa1c2/src/brickd#

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...