eclipse / mraa

Linux Library for low speed IO Communication in C with bindings for C++, Python, Node.js & Java. Supports generic io platforms, as well as Intel Edison, Intel Joule, Raspberry Pi and many more.
http://mraa.io
MIT License
1.37k stars 613 forks source link

Support: DFRobot Romeo and DFRobot IO Expansion Shield #173

Open rwaldron opened 9 years ago

rwaldron commented 9 years ago

(Currently neither are in stock)

It seems feasible that they will both work out-of-the-box, being identified as the Arduino Board. If not, I was wondering if support for these could be included in mraa (once they become available, of course).

arfoll commented 9 years ago

We should definately support those - thanks for pointing these out. In the meantime if someone has one and wants to help please shout!

rwaldron commented 9 years ago

Update: I added the "Romeo for Edison Controller (Without Intel® Edison)" to the list in the OP.

rwaldron commented 9 years ago

@arfoll @tingleby

My order of both of these has just shipped, so presumably they are all back in stock (unless pre-orders wipes them out?)

arfoll commented 9 years ago

I still haven't got one of these, hopefully soon. I did however receive one of the xadow edison baords - http://www.seeedstudio.com/wiki/Xadow_-_Edison

rwaldron commented 9 years ago

@arfoll that's totally awesome, thanks for the link!

rwaldron commented 9 years ago

Quick update: the DFRobot Romeo for Intel Edison is being detected as the 56 pin mini breakout.

alext-mkrs commented 8 years ago

@rwaldron so how did this go, have you been able to run both shields or have you got any problems? Do you think there's work to be done in mraa for those?

rwaldron commented 8 years ago

so how did this go,

Not very well. I ran out of resource time to work on learning the best way to detect that the Edison is attached to one of these expansion shields. It's necessary to for mraa to know that information because AIO is provided by an I2C IO expander chip on the Romeo. Just testing for some device on the i2c bus with that address is potentially ambiguous. Here's the code they link to from the dfrobot wiki: https://github.com/ouki-wang/remeo4edison

Do you think there's a work to be done in mraa for those?

Ideally, figuring out how mraa can "know" it's running on either of these, the same way it "knows" that if it's running on Arduino Breakout or Mini Breakout. Currently, it behaves as though it's always Mini Breakout, which won't make sense for the end developer.

jiangzidong commented 8 years ago

@rwaldron and @arfoll I met the same problem that Romeo is recognized as 'breakout board'. while is can work well with Arduino IDE. Have this problem been solved? or is there some workaround?

codebikeclimb commented 8 years ago

My Romeo for Edison is no longer programmable from the Arduino IDE. I set it up with Visual Studio and I can cross-compile C++ scripts and run them on the Edison or I can transfer the script via SFTP using WinSCP and compile and run them locally from the Edison's terminal. I am working on trying to use the GPIO & Analog pins from the Arduino breakout, but I can't figure out the mraa pin mapping. Lets say I want to hook up a sensor to digital pins 10 & 11 on the breakout, how do I control those pins through C++ and mraa?

tcassell94 commented 7 years ago

Has there been any work done in this area?

Looking to use the mraa library to work with the Gpio on Edison using the DFRobot IO Expansion board Is it currently possible to do that? I had code working on the Arduino breakout board that does not work at all with the IO Expansion board. Is there something I need to change, or is it not possible at all with the current state of the mraa library?

EDIT: I understand now that you must use the mraa pin numbers according to the Intel Mini Breakout board. Switching to that has worked.

anzocles commented 7 years ago

Dear tcassell94, you can access to any pin of the romeo boar for edison via mraa? I tried as described in https://medium.com/@monkeytypewritr/control-your-intel-edison-in-realtime-with-websockets-f16e49b2b2c8 ... no success. I tried the examples (f.e. the blink programmes) in python, node. Uploading sketches with the arduino ide is working, also running the elf files via exec. (Sorry for that bad English.)

alext-mkrs commented 7 years ago

The repo link for mraa in that article is way outdated, see the main readme in the repo for an up-to-date one and give it a try.

anzocles commented 7 years ago

Dear alext-mkrs, thank you very mutch for answering!

Yes, I've updated to poky 3.5 (iot-devkit-prof-dev-image-edison-20160606.zip) with the packages in https://iotdk.intel.com/repos/3.5/intelgalactic-dev/opkg/i586/ the example mraa/examples/javascript/Blink-IO.js does not let the led blink. (Same with the python version mraa/examples/python/blink-io8.py) ... something I am doing wrong ...

--- update --- I've uploaded the firmware/sketch NG.ino Version 1.3 ( https://github.com/ouki-wang/remeo4edison ) on the ATmega8 (the motor controller of the romeo for edison board). No change, the mraa examples are not working (still no blinking led). Via arduino sketch: no problem.

anzocles commented 7 years ago

may be a permission problem? I am using the romeo for edison controller SKU: DFR0331 from dfrobot. The installed image of poky (more /etc/version): 201606061707 The mraa version (opkg list-installed | grep mraa): mraa - 1.6.1

When using the "python terminal" (typing python in the shell/terminal) and try to light the LED on pin 13 with a x.write(1) the result is 0 instead of 1 - no light on:

import mraa x = mraa.Gpio(13) x.dir(mraa.DIR_OUT) 0 x.write(1) 0

The root cannot do this? A visudo gives following permission: root ALL=(ALL) ALL Hmmm ... seems to be ok. Very strange.

tcassell94 commented 7 years ago

Because these boards aren't supported by mraa (in terms of their pins not being "rerouted" correctly) you must use the raw Edison PIN number. To do this, look at the schematic for the Romeo board (https://www.dfrobot.com/wiki/index.php/Romeo_for_Edison_Controller_SKU:_DFR0331 - first link under development tools) and match the Gpio number to the GP number. For Gpio 13, which is D13 in the schematic, the GP number is GP40. Then, go to the mraa library page for the Edison Mini Breakout board (https://iotdk.intel.com/docs/master/mraa/edison.html) and match the GP number to the mraa number. For GP40 the mraa number is 37. So in your code above, change the pin number to 37 and your code will work on pin 13.

anzocles commented 7 years ago

Dear tcassell94, great - it's little bit like treasure hunting with two maps - and it works: the LED is blinking! Hurrah! Thank you!