Hello all - I've recently assembled my second Nybble, this time with a Raspberry Pi. I'm hoping to experiment with new behaviors and abilities. For now, I simply want to remotely connect to the RasPi and control Nybble through its terminal. But I'm having some trouble with the serial connection (I think).
I did my best to follow the guide here: https://www.petoi.com/forum/hardware/how-to-setup-raspberry-pi-for-programming-nybble-without-ftdi-module but I may have made a mistake or two along the way. Any other advice or resources on getting Nybble up and running with a RasPi?
I remember there was some permission to be assigned to the script if you are using Linux.
Thank you for your reply.
I checked my correct Bluetooth name (it is BittleSPP-877324) and replaced my ardSerial.py line 9 as follow;
port='/dev/cu.BittleSPP-877324-Port',#'/dev/ttyS0'
However, the error was almost the same. "[Errno 2] could not open port /dev/cu.BittleSPP-877324-Port:"
Just to be sure, I tried another pattern,
port='/dev/cu.BittleSPP-877324',#'/dev/ttyS0'
I found same error No.2..
And I typed on the RasPI terminal "ls /dev | grep Bittle " before and after to execute ardSerial.py.
Yes, you need to check the actual Bluetooth device's name of your Bittle connector, and replace the line with the correct name. You can
ls /dev | grep Bittle
after connecting to the Bluetooth dongle.
I'm trying to connect Bittle and Raspberry Pi by user manual.
I reached manual 4.4.3. "Use ardSerial.py as the commander of Bittle" ., but I found the error as follows;
Traceback (most recent call last):
File "./ardSerial.py", line 14, in <module>
timeout=1
File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 240, in __init__
self.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 268, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/cu.BittleSPP-3534C8-Port: [Errno 2] No such file or directory: '/dev/cu.BittleSPP-3534C8-Port'
Do I need to rewrite ardSerial.py to be Bittle-specific?
I've got to say, I'm a newly minted massive fan of the 3A+ for this sort of application. So much less bulk than the B, and the idea of running an erlang controller process is extremely tempting. So far it seems safe to have a power supply plugged into the Pi and to have the main battery coming and going, which answers a worry I had early on. I haven't figured out how to trigger a nyboard reset from the pi yet, though, and that would be extremely convenient.
Solved! I was confused on multiple fronts.
1: I'm using a Raspberry Pi 3A+, but was following guides for setting up ports on the 3B. This involved all sorts of port switching with config.txt that was unnecessary, and causing the script to fail.
2: I didn't realize the switch on NyBoard needs to remain on Ar even when sending commands with Pi over serial. This thread changed my life.
3: I was able to connect to the NyBoard, but only heard beeps – no movement on Nybble. As I'm using NyBoard 0_2, I changed the baud rate in ardSerial.py to 57600. And it worked!
Phew! This took a few days of troubleshooting. 😅
[Errno 13] could not open port /dev/tty50
That is unlikely to be the right serial port filename. It looks like you've mistaken a capital 'S' for a '5'.
You need to find the right serial port connected to the NyBoard.
Also! I made the mistake of attempting to follow the instructions for setting up Pi for programming without the FTDI module – far more advanced than what I needed.
I've freshly calibrated my Nybble and it's working great with NyBoard. But when I flip the switch to Pi and attempt to use my 3A+ to use ardSerial.py, I get the following error:
Traceback (most recent call last): File "./ardSerial.py", line 14, in <module> timeout=1 File "/usr/lib/python2.7/dist-packages/serial/serialutil.py", line 240, in __init__ self.open() File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 268, in open raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg)) serial.serialutil.SerialException: [Errno 13] could not open port /dev/tty50: [Errno 13] Permission denied: '/dev/tty50'
Serial login is disabled, and the port is enabled via raspi-config. If I run .ardSerial.py as sudo, I can see that it runs but the Nybble doesn't respond. Seems like I haven't configured the port properly – any advice? I'd love to get my Nybble working with the Python Web API!
Do you have any videos/screenshots elaborating on your problems? It's hard to diagnose with limited information.
Thought I'd leave a comment on my own post just to keep things going. I'll be doing my best to puzzle through it, and will share what I learn if I can figure it out.