tag:blogger.com,1999:blog-5416726460697111362.post9026435032271015809..comments2024-03-13T11:50:16.986-07:00Comments on Dr. Monk's DIY Electronics Blog: Raspberry Pi and ArduinoSimon Monkhttp://www.blogger.com/profile/11397717497833049913noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-5416726460697111362.post-54915746512703472312015-01-27T01:41:02.084-08:002015-01-27T01:41:02.084-08:00Hi Mr.Simon
I really liked this blog post, and I w...Hi Mr.Simon<br />I really liked this blog post, and I was very happy when I saw the setup working!<br />but I have one question. Why does the command ser.write('n') doesn't work with more than one digit numbers? Is there any improvisation to the code to fix this output bug?<br />Thank you<br />Ninaad Das<br />from IndiaNinaad Dashttps://www.blogger.com/profile/05240777833489590297noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-60540052041229742252014-04-08T04:17:06.986-07:002014-04-08T04:17:06.986-07:00hi simon i was using my arduino NG with atmega 8 f...hi simon i was using my arduino NG with atmega 8 for two months but for a week shows some errors like<br />Arduino: 1.5.6-r2 (Windows 8), Board: "Arduino NG or older, ATmega8"<br /><br />In file included from C:\Users\Aditya\arduino1.6\Arduino\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp:32:<br />C:\Users\Aditya\arduino1.6\Arduino\hardware\arduino\avr\cores\arduino\/HardwareSerial_private.h: In member function 'void HardwareSerial::_rx_complete_irq()':<br />C:\Users\Aditya\arduino1.6\Arduino\hardware\arduino\avr\cores\arduino\/HardwareSerial_private.h:98: error: 'UPE' was not declared in this scope<br /><br /> This report would have more information with<br /> "Show verbose output during compilation"<br /> enabled in File > Preferences.<br /><br />can you please reply me about the issue pleaseadithyahttps://www.blogger.com/profile/11361225255464709477noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-35629266100136645532014-04-08T04:15:10.444-07:002014-04-08T04:15:10.444-07:00hi mr.simon
i have a issue with my arduino basical...hi mr.simon<br />i have a issue with my arduino basically i use a arduino NG with atmega8 controller and for a few months i was able to upload programs but this week it shows soe errors like<br />Arduino: 1.5.6-r2 (Windows 8), Board: "Arduino NG or older, ATmega8"<br /><br />In file included from C:\Users\Aditya\arduino1.6\Arduino\hardware\arduino\avr\cores\arduino\HardwareSerial.cpp:32:<br />C:\Users\Aditya\arduino1.6\Arduino\hardware\arduino\avr\cores\arduino\/HardwareSerial_private.h: In member function 'void HardwareSerial::_rx_complete_irq()':<br />C:\Users\Aditya\arduino1.6\Arduino\hardware\arduino\avr\cores\arduino\/HardwareSerial_private.h:98: error: 'UPE' was not declared in this scope<br /><br /> This report would have more information with<br /> "Show verbose output during compilation"<br /> enabled in File > Preferences.<br />even if i just hit complie without any program it shows the error <br />could you please elp me ......<br />my email id is adithyaad96@gmail.comadithyahttps://www.blogger.com/profile/11361225255464709477noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-19389055638354294752014-03-01T09:09:21.290-08:002014-03-01T09:09:21.290-08:00I am getting:
Permission denied: 'dev/ttyAMAO...I am getting:<br /><br />Permission denied: 'dev/ttyAMAO'<br /><br />I have read that I can "free my pi serial port" but would like not to have to do this... how can I solve this?<br /><br />Thank youAnonymoushttps://www.blogger.com/profile/03752151015240951130noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-581937252865152262014-01-10T13:21:27.287-08:002014-01-10T13:21:27.287-08:00For those having issues making this into a script,...For those having issues making this into a script, I found that you need to issue the following commands<br /><br /><i><br />time.sleep(1)<br />ser.setDTR(level=0)<br />time.sleep(1)<br /></i><br /><br />Reason:<br />The Arduino resets when a serial connection is opened. So you need to make your script wait until it is finished resetting.Anonymoushttps://www.blogger.com/profile/00824976495406147203noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-32399600040198416522014-01-07T12:47:19.984-08:002014-01-07T12:47:19.984-08:00Is there any way to set a static port name for the...Is there any way to set a static port name for the arduino or configure so it automatically knows the port name ?Leohttps://www.blogger.com/profile/05793840699544988166noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-67734252624082283252013-07-20T00:17:19.668-07:002013-07-20T00:17:19.668-07:00Thanks for this article.
Works great!
I'm wai...Thanks for this article.<br />Works great!<br /><br />I'm waiting next chapters of Your book... :-))<br /><br />Luigi from ItalyAnonymoushttps://www.blogger.com/profile/01989428187640800355noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-16551367877291434002013-04-07T13:06:06.206-07:002013-04-07T13:06:06.206-07:00Hi. I should remind myself every time I have a pro...Hi. I should remind myself every time I have a problem that I actually know very little.<br /><br />This article is now in the "Programming the Raspberry Pi" book by Dr. Monk and that book is what I am using to get going with the RPi. I had the following error message when I tried to execute everything in the IDLE editor:<br />************************8<br />>>> import serial<br />>>> ser = serial.Serial('dev/ttyACM0', 9600)<br /><br />Traceback (most recent call last):<br /> File "", line 1, in <br /> ser = serial.Serial('dev/ttyACM0', 9600)<br /> File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 260, in __init__<br /> self.open()<br /> File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 276, in open<br /> raise SerialException("could not open port %s: %s" % (self._port, msg))<br />SerialException: could not open port dev/ttyACM0: [Errno 2] No such file or directory: 'dev/ttyACM0'<br />***************************<br />I searched the RPi forums with nothing useful to me as I still know little about using Linux. Then I searched Yahoo! using the full error message and came across the following link:<br />http://www.tracemyworld.com/site/en/support/documentation.html?start=7<br /><br />I found that using the ls /dev/ACM0 command did not give me what I wanted but then later tried just this:<br />ls /dev/<br />which showed me that there was a USB device present where there was none when the Arduino was not plugged in.<br /><br />At this point, it is helpful to know I am using and Arduino Duemilanove and a Freeduino SB, V 2.l which is pretty much the same thing as the Duemilanove. Once I figured the new USB device listing out, I started experimenting with the code and using two Arduino's. The LEDs blink so quickly so I slowed down the blinking. When I started to enter in numbers with more than 1 digit, I found out the Arduino sketch will blink each digit in series - fun!<br /><br />Dr. Monk, if you have a forum or other venue for posting the differences that people have with hardware and software, it would be appreciated if you posted a link. I have not found it yet. The RPi forum would be a good place to search for that - I might start a thread.playinmyblueshttps://www.blogger.com/profile/08122610248797518781noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-21139857795730612352013-03-23T03:12:43.080-07:002013-03-23T03:12:43.080-07:00Hi, thank you so much for posting this. I am havi...Hi, thank you so much for posting this. I am having some trouble though on Raspbian.<br /><br />It installs fine, but there is no "Python 2" under programming.<br /><br />Any suggestions?<br />Thanks again!NUTSgoWEEEhttps://www.blogger.com/profile/00860501299559196305noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-35481931225967491322013-03-06T20:58:06.406-08:002013-03-06T20:58:06.406-08:00hi, i'm Sergio.
What do you do with this:
(Se...hi, i'm Sergio.<br />What do you do with this: <br />(Serial.read() - '0') ?<br />Thanks and regards from SpainTodo en casahttps://www.blogger.com/profile/05944381771720908983noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-78617227277213384612013-02-03T02:54:12.696-08:002013-02-03T02:54:12.696-08:00Hi, Dr. Monk
Your article was just what I was loo...Hi, Dr. Monk<br /><br />Your article was just what I was looking for: I have mounted my Arduino to a 4-wheel chassis, connected my Pi to the Arduino and am now able to control the motors via SSH and a python shell.<br /><br />Now the next step for me is to make a python script that I can call with an argument so that the argument is sent to the Arduino, so that I do not have to go into a python shell to control it but I have encountered a problem:<br /><br />When I execute the script, the return value of ser.write() is 1, but the Arduino does not react (although the RX LED blinks).<br /><br />This is my script so far:<br /><br />#!/usr/bin/python<br /><br />import serial<br /><br />baudrate = 9600<br /><br />ser = serial.Serial('/dev/ttyUSB1', baudrate)<br />ret = ser.write('B')<br /><br /># This prints '1'<br />print(ret)<br /><br /><br />Any ideas as of what might be wrong?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-86475854842012307522013-02-03T02:49:08.756-08:002013-02-03T02:49:08.756-08:00Hi, Dr. Monk
Your article was just what I was loo...Hi, Dr. Monk<br /><br />Your article was just what I was looking for: I have mounted my Arduino to a 4-wheel chassis, connected my Pi to the Arduino and am now able to control the motors via SSH in a python shell.<br /><br />Now the next step for me is to make a python script that I can call with an argument so that the argument is sent to the Arduino, so that I do not have to go into a python shell to control it but I have encountered a problem:<br /><br />When I execute the script, the return value of ser.write() is 1, but the Arduino does not react (although the RX LED blinks).<br /><br />This is my script so far:<br /><br />#!/usr/bin/python<br /><br />import sys<br />import serial<br /><br />baudrate = 9600<br />direction = sys.argv[1]<br /><br />ser = serial.Serial('/dev/ttyUSB1', baudrate)<br /># Writes 'F' as in Foreward. Works in python shell.<br />ret = ser.write('F')<br /><br /># This prints '1'<br />print(ret)<br /><br /><br />Any ideas as of what might be wrong?TechMasterhttps://www.blogger.com/profile/03351776548344114841noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-11695436513788738752013-01-10T14:42:36.155-08:002013-01-10T14:42:36.155-08:00My Raspberry PI Doorbell server written with Pytho...My Raspberry PI Doorbell server written with Python, activates randomly - the detection of the button press makes the voltage on the switch go from 1 down to 0 in small increments - the code looks for change rather than either 1 or 0 - is the code at fault or do you think I need a shield - or go for something like <a href="http://www.fastestpc.co.uk/product/692153387/arduino-mega2560-a000067-board-r3.html" rel="nofollow">This</a>Anonymoushttps://www.blogger.com/profile/02684101212290746063noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-40270639897442180082013-01-03T14:16:46.543-08:002013-01-03T14:16:46.543-08:00Thanks for the info Dr Monk. I've got my Leona...Thanks for the info Dr Monk. I've got my Leonardo clone sending back serial output and printing that out via Python on the PiMichael Hornehttps://www.blogger.com/profile/14798421679757500628noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-13499050363174066762012-12-18T11:00:44.401-08:002012-12-18T11:00:44.401-08:00Is there any way to make this script-able?
I'...Is there any way to make this script-able?<br /><br />I'd like to be able to read the Arduino via a Python but I can't get anything that I am sending. <br /><br />The post mentions you have to press enter twice to see the data. Is there anyway to include this in the script. Also, why is it necessary to press enter twice? Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-5491241270030874892012-12-18T11:00:04.721-08:002012-12-18T11:00:04.721-08:00Is there any way to make this script-able?
I'...Is there any way to make this script-able?<br /><br />I'd like to be able to read the Arduino via a Python but I can't get anything that I am sending. <br /><br />The post mentions you have to press enter twice to see the data. Is there anyway to include this in the script. Also, why is it necessary to press enter twice? Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-65401499616002005522012-12-18T10:58:41.296-08:002012-12-18T10:58:41.296-08:00Is there any way to make this script-able?
I'...Is there any way to make this script-able?<br /><br />I'd like to be able to read the Arduino via a Python but I can't get anything that I am sending. <br /><br />The post mentions you have to press enter twice to see the data. Is there anyway to include this in the script. Also, why is it necessary to press enter twice? Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-91774713982507725632012-09-18T08:40:21.280-07:002012-09-18T08:40:21.280-07:00Thanks for this article.
But something strange ha...Thanks for this article.<br /><br />But something strange happens to me. The code is workin but when i put it in a file.py and execute that is not working the write('5')<br /><br />Somebody have an idea what this can be?<br /><br />Thanks!Acehttps://www.blogger.com/profile/04123994295049156715noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-42534115546006784082012-09-14T05:46:11.039-07:002012-09-14T05:46:11.039-07:00Cant get this to work on my Duemilnove. The led on...Cant get this to work on my Duemilnove. The led on the Duemilnove flashes when the while loop is running, but no message back to the Pi. Nothing at all happens when I try the ser.write.<br /><br />any idea's,, hoping I dont need to replace my Duemilnove with an Uno.<br /><br />thanksAshmanhttps://www.blogger.com/profile/16260197602408269353noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-61861413592831156312012-08-16T13:22:48.393-07:002012-08-16T13:22:48.393-07:00I can open the USB port apparently, but when I get...I can open the USB port apparently, but when I get to the read or write, it complains than the module (serial???) doesn't have an attirbute -- doesn't apparently know how to read or write. I'm following your example, but something seems to be haywire. Thanks! /paul W3FIS<br /><br /><br />Paul Rosshttps://www.blogger.com/profile/06980420011453798678noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-543760142979828592012-08-16T05:06:04.018-07:002012-08-16T05:06:04.018-07:00Alternatively, you could run Firmata on your Ardui...Alternatively, you could run Firmata on your Arduino, and use its interface to Python for control. Here's a simple example I put together (with a pretty GUI, too): <a href="http://scruss.com/blog/2012/08/16/raspberry-pi-python-arduino-and-a-gui/" rel="nofollow">Raspberry Pi, Python & Arduino *and* a GUI …</a>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-84339062273389486342012-07-10T12:38:45.442-07:002012-07-10T12:38:45.442-07:00Thank you for this article! It inspired me to try ...Thank you for this article! It inspired me to try and connect the Raspberry Pi and Arduino using the GPIO UART on the Raspberry Pi and SoftSerial on two other pins on the Arduino. This way you still have the USB available for your serial monitor to do debugging with.<br /><br />Here is my article: <a href="http://www.andremiller.net/content/raspberry-pi-and-arduino-via-gpio-uart" rel="nofollow">Raspberry Pi and Arduino via GPIO UART</a>Anonymoushttps://www.blogger.com/profile/02265205044643673129noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-52910730553473989832012-07-09T09:42:27.884-07:002012-07-09T09:42:27.884-07:00Unable to finish the tutorial, I run step 1 and th...Unable to finish the tutorial, I run step 1 and then my browser crashes when I visit this page from my raspi.<br /><br />Raspberry with debian and midori as browser, the log says "out of memory", I have also installed apache, php, Mysql.<br /><br />Am I the only one with this malfunction?Anonymoushttps://www.blogger.com/profile/16182942149529258165noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-64197034766218545132012-07-09T09:37:25.973-07:002012-07-09T09:37:25.973-07:00run step 1 and then my browser (midori),crashes wh...run step 1 and then my browser (midori),crashes when I visit this page from my raspi.<br />Raspberry with debian and midori as a browser, the log says "out of memory", I have also installed apache, php, Mysql.<br /><br />Am I the only one with this malfunction?Anonymoushttps://www.blogger.com/profile/16182942149529258165noreply@blogger.comtag:blogger.com,1999:blog-5416726460697111362.post-785081058290961162012-07-05T06:03:43.061-07:002012-07-05T06:03:43.061-07:00Hey Simon, thanks for the writeup.
With regard to...Hey Simon, thanks for the writeup.<br /><br />With regard to the older boards (FTDI) I can confirm that my Arduino Minis work fine using this method (they can even be programmed from the Pi) <br /><br />dmesg output:<br /><br /><br />[ 6.152837] usb 1-1.2: new full speed USB device number 4 using dwc_otg<br />[ 6.279186] usb 1-1.2: New USB device found, idVendor=0403, idProduct=6001<br />[ 6.295385] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br />[ 6.310300] usb 1-1.2: Product: FT232R USB UART<br />[ 6.323101] usb 1-1.2: Manufacturer: FTDI<br />[ 6.334651] usb 1-1.2: SerialNumber: A600aPpA<br /><br /><br />and program:<br /><br /><br />doug@raspberrypi ~/arduino_dev/sketchbook/initial_playing $ sudo make upload<br />for STTYF in 'stty -F' 'stty --file' 'stty -f' 'stty <' ; \<br /> do $STTYF /dev/tty >/dev/null 2>/dev/null && break ; \<br /> done ;\<br /> $STTYF /dev/ttyUSB0 hupcl ;\<br /> (sleep 0.1 || sleep 1) ;\<br /> $STTYF /dev/ttyUSB0 -hupcl<br />/usr/bin/avrdude -q -V -p atmega168 -C /etc/avrdude.conf -c arduino -b 19200 -P /dev/ttyUSB0 \<br /> -U flash:w:build-cli/initial_playing.hex:i<br /><br />avrdude: AVR device initialized and ready to accept instructions<br />avrdude: Device signature = 0x1e9406<br />avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed<br /> To disable this feature, specify the -D option.<br />avrdude: erasing chip<br />avrdude: reading input file "build-cli/initial_playing.hex"<br />avrdude: writing flash (4836 bytes):<br />avrdude: 4836 bytes of flash written<br /><br />avrdude: safemode: Fuses OK<br /><br />avrdude done. Thank you.DougEdeyhttps://www.blogger.com/profile/16973527810380349219noreply@blogger.com