pcDuino Arduino on steriods – better than new Arduino Yun?

TheSpaceProjectS Information version 0.1


XinCheJian has several pcDuino and LinkSprite sensor packs. Using the pcDuino, in the TheSpaceProjectS. shows that the pcDuino really delivers and gives great first impressions:

  • First power on – boots up to a preloaded Lubuntu with XBMC
  • similar GPIO pins to an Arduino.
  • GPIO pins can be controlled from many languages
  • access  Linux commands from your code
  • Arduino “emulation” runs directly on the Linux hardware!
  • internet shows good information and code samples
  • looks like reasonable maturity with I2C and SPI support
  • usage – it all just works nicely!

Arduino “emulation” – ie running Arduino GUI with Arduino code on the pcDuino hardware – just works.

This is a really big feature that does not seem to have had much attention! There are a few differences to “standard” Arduino and some BIG extra features:-

  • compiled program is copied to /home/ubuntu/Arduino/YourCodeName.cpp
  • …and you can then run the program outside of Ard gui, even have it run on startup.
  • In an Arduino, you might not notice if your code crashes. In a pcDuino crashes can be more obvious! If you do something bad in your code (like going beyond array bounds) – the terminal running your Arduino code might crash!
  • your code does NOT run all the time power is applied like on Arduino, but only when you run it.
  • memory – code size limits – seem to have vanished! A simple sketch “Binary sketch size: 17,517 byes (of a 104,857,600 byte maximum) – 0% used”. Then adding MANY k of text, yet compiled code size only increased by about 1k!
  • reset switch is just like Arduino – it resets the entire board, but with pcDuino – this means instantly rebooting your Linux environment!
  • write data to SD card – no more loosing Arduino IO pins to an SD card shield (ditto for networking…)
  • can run shell commands etc (after all Arduino code is C/C++), like curl, wget, echo, system, etc

Other notes:

  • Found it necessary to to do a full system update via the F8 boot menu and that not all Arduino libraries are yet available/functional – eg SoftwareSerial.
  • The physical header layout seems odd with a non-Arduino layout and most headers on one side. Maybe some background on their design decisions on those layout choices would explain this.
  • Speed – guess it runs way faster than Arduino – but have not checked yet, although compilation process is quite slow.

Functionality tested so far from Arduino code:

  • switches on GPIO to trigger running different Linux applications
  • open web pages
  • send emails
  • log to file
  • flashing LEDs
  • several analogue sensors

The LinkSprite translation board (T board) shield provides a standard Arduino shield pin layout so you can use your existing Arduino 5v shields and code, run faster and access the added Linux capability!

That is actually very impressive! What other capability is there to discover? Guess need to explore this device some more – for example interrupts, sleep, timers.

Co-incidentally there is a lot of press about the new Arduino Yun, which is also an Arduino + Linux hardware. The Yun has both Arduino & Linux hardware (plus WiFi) and has a serial bridge and library that allows communication between the Arduino and Linux hardware. The pcDuino does not have the additional Arduino processor, but does provide almost the same IO pins with control via the same Arduino programming IDE.

So the Yun is an Arduino (Leonardo) and has direct control of all IO, plus has some control of the Linux WiFi and other functions, and the pcDuino has direct control of all IO and Linux functions, plus if programming via Arduino IDE provides significantly extended Arduino capability.

I don’t have a Yun to try so I can’t answer this posts title question, but I can definitely say the pcDuino really delivers and shows promise of improving further!

Summary: pcDuino is a highly functional mini-Linux system that also adds several BIG features to Arduino capability, plus everything works right out of the box!

Arduino Leonardo’s style boards, upload and serial terminal issues

Trying to add a bit more wisdom to all the existing information that is around the web based on my tribulations with a SwarmRobot 32u4 based board (core of the Leonardo) and a SeeedStudio Xadow.

As everyone notes, on uploading your code, BOTH the computer AND the Leonardo drop/break the USB connection and then attempt to re-establish. The practical issues that this can cause, is where I had issues and found little information. So here are my 2 cents worth:

If both ends successfully re-connect:-

  • the port may have a different name/number. Recent Arduino programming GUI versions usually auto-detect the change. If not, you may have one of the other issues below.  Older Arduino programming GUI versions did not auto-detect and you had to manually change the port.
  • Sometimes auto-upload works, other times you have to press the Leonardo reset button. It seems to run in streaks, working reliably for auto, then for manual reset. Don’t know how to reliably fix this. Sometimes solutions here work, often not.
  • Sometimes Arduino autodetects the port correctly, but does not select it, so you need to check and select it.

If either end does not re-connect, try:-

  • unplug USB cable, wait a few seconds then replug it in, then recheck port shows correctly in the Arduino GUI
  • sometimes moving USB cable to a DIFFERENT USB port helps
  • close and reopen the Arduino programming GUI, especially if you see red messages like “lib rxtx cannot access the com port”.
  • reboot your computer and power off/on the Leonardo and if you see the above message. Under Windows 7, the following message usually means a computer reboot for me “processing.app.debug.RunnerException: Couldn’t find a Leonardo on the selected port. Check that you have the correct port selected.  If it is correct, try pressing the board’s reset button after initiating the upload.
    at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:153)”
  • do all BOTH of the above
  • If the com port is greyed out, try selecting the com port during that brief moment of disconnection and before reconnection after board is reset. Using your operating system sound events for this is very handy!
  • in addition to HID control of mouse or keyboard that you have programmed, I suspect that on some Leonardo style boards active HID control sometimes causes issues. I use a few seconds delay in setup function to avoid this at least while developing my code, in addition to the generally suggested method to easily disabled HID mouse/keyboard control.
  • Sometimes you end up with multiple copies of Avrdude running and using a lot of CPU. For me this occurs occasionally under OpenSuse.
  • All my attempts to get OpenSuse working with Xadow failed for weeks, until I left the Xadow plugged in at computer power on/boot, then ran the Arduino GUI with root privilege, then after that the GUI ran OK with userlevel privileges. I really do not understand why this is so!

Hello Lophilo

No “Hello World”, no blinking LEDs yet, but the Lophilo LEDs are controllable through the example shell scripts!

Lophilo signed board #2 All LEDs on.
Lophilo signed board #2 All LEDs on.
Lophilo signed board #2 1 LED via shell script and button push.
Lophilo signed board #2 1 LED via shell script and button push.








First impressions

  • more in the box than I expected – already almost complete, extremely professional!
  • WOW – signed board #2!
  • it is a very complex PCB
  • it really is a computer (ahem you have to push the on button, not just plug it in “:oops:”)
  • I can’t wait to get stuck into the FPGA – have several projects in mind
  • I can’t wait to get into the cloud9 environment
  • I can’t wait do heaps more

The new Lophilo board has also been run through most of the test procedure successfully. The tests that have not yet been completed are due to my poor Linux skills!

The training that is included with this version of the Lophilo will help fix that and get me up to speed with the FPGA.

LittleWire programming Xinchejian SwarmRobot AtTiny

LittleWire programming Xinchejian SwarmRobot AtTiny via Arduino GUI
LittleWire programming Xinchejian SwarmRobot AtTiny via Arduino GUI

The LittleWire was mainly purchased to support Ihsan as he has been very open, providing a lot of really interesting information about his build process and design and it has also been interesting seeing the DangerousPrototypes community helping that process and even building many variations.

But now it looks like it will become my main and highly used programmer and in high demand for the Swarm Robot project, so I might have trouble finding time to play with all the other modes it has!

Thanks Ihsan!

USB device detected, but no USB port assigned – Ubuntu

This issue, where a USB device is detected, but no USB port assigned has taken me a lot of effort to solve on several occasions, because I forgot the fix each time, so hopefully this post might help you!

In short if you connect a ‘new’ USB device and it does not ‘work’, but dmesg reports something like below and the device number increments on every dis/reconnect:
usb 4-2: new full speed USB device number 11 using uhci_hcd

The issue is that no USB port has been assigned, as seen below in this successful connection:
usb 4-2: new full speed USB device number 12 using uhci_hcd
cdc_acm 4-2:1.0: ttyACM0: USB ACM device

The following fix has worked for me on three, maybe four, systems:
sudo modprobe cdc_acm

The systems it definitely fixed were the Dangerous Prototypes OLS, a USnooBie and just this week, an Arduino UNO v2.0. Plus it probably fixed a Dangerous Prototypes BusBlaster, but my notes don’t document and it almost certainly would have fixed the very long saga I had with the Dangerous Prototypes IRToy, but it went a different, painful process, that I won’t be able to reproduce, but the root issue seemed the same.

While three of these systems are all from Dangerous Prototypes, ALL five have a different hardware USB implementation! The Arduino and Dangerous Prototypes devices are also all very popular.

Two references that helped were 1 and 2. The second, Gentoo link, talks about modprobe cdc_acm and interestingly modprobe ftdi_sio, which I have not used, but am trying to burn into my brain for the next issue I have. I must have used other sites – but apologies to them as I forgot to record the sources 🙁

Possibly relevant background information:

I only use the one Ubuntu laptop, so have not run into this on any other systems! The build started with 10.10 and took all upgrades up to 11.10. These devices all worked on Windows XP Pro, with only a couple of minor issues.

I have successfully used lots of other devices on the same Ubuntu laptop, including an Arduino Deumilanove, a DP BusPirate, a DP USB LCD Backpack, and three different types of USB to TTL (FTDI) convertors.

Highly relevant background information = I break stuff – lots of stuff, just by touch and sometimes it seems just by looking.