{"id":7872,"date":"2019-08-07T00:39:58","date_gmt":"2019-08-06T23:39:58","guid":{"rendered":"https:\/\/stevepedwards.today\/ElectronicsStuff\/DebianAdmin\/?p=7872"},"modified":"2019-09-24T21:05:44","modified_gmt":"2019-09-24T20:05:44","slug":"arduino-and-linux","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/ElectronicsStuff\/arduino-and-linux\/","title":{"rendered":"Arduino Intro on Linux Mint"},"content":{"rendered":"<p>I bought the Elegoo R3 Project Super Starter kit from Amazon, -\u00a330:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7892 aligncenter\" src=\"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-content\/uploads\/2019\/08\/r3kit-1024x549.png\" alt=\"\" width=\"840\" height=\"450\" \/><br \/>\nWhat you get, more or less:<br \/>\n<iframe loading=\"lazy\" title=\"Arduino Starter Kit from Elegoo\" width=\"1778\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/zOddoUpW6WM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><br \/>\n<iframe loading=\"lazy\" title=\"You can learn Arduino in 15 minutes.\" width=\"1778\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/nL34zDTPkcs?start=788&feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><br \/>\nIn one evening I got the first basics done - A\/D converter-\u00a0 resistor, temp\/humidity sensor then the thermistor\/LCD projects. Very educational!<br \/>\n<span style=\"color: #0000ff;\">sudo apt install arduino<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo tail -f \/var\/log\/syslog<\/span><br \/>\nPlug in Arduino Uno R3 to printer cable and PC USB to find serial\/USB name, which for me is:-\u00a0 \/dev\/ttyACM0<br \/>\n<span style=\"color: #ff0000;\">Aug 7 00:38:53 quad kernel: [14028.054126] cdc_acm 7-1:1.0: <strong>ttyACM0<\/strong>: USB ACM device<\/span><br \/>\nYou may need to be added to the dialout group and make the device rw:<br \/>\n<span style=\"color: #0000ff;\">sudo chmod a+wr \/dev\/ttyACM0<\/span><br \/>\n<span style=\"color: #0000ff;\">sudo adduser stevee dialout<\/span><br \/>\n*Version 8.9-\u00a0 now wants:<br \/>\n<span style=\"color: #ff0000;\">stevee@quad ~\/Arduino\/arduino-1.8.9 $ sh arduino-linux-setup.sh stevee<\/span><br \/>\n<span style=\"color: #ff0000;\">******* Add User to<strong> dialout,tty, uucp, plugdev<\/strong> groups *******<\/span><br \/>\nThe main problem you may meet at install is if you have (naturally !) created a folder called \/Arduino and unpacked the zip of the IDE and examples in there, as it complains that your are in the same folder as the sketchbook - even if sketchbook does not exist AT ALL! Why they just dont say \"not inside Arduino folder\" or similar I dunno!<br \/>\n<span style=\"color: #0000ff;\"><em>\"Picked up JAVA_TOOL_OPTIONS: <\/em><\/span><br \/>\n<span style=\"color: #0000ff;\"><em>Incorrect IDE installation folder: Your copy of the IDE is installed in a subfolder of your sketchbook.\"<\/em><\/span><br \/>\nMove the unzipped \/arduino-1.8.x\/ outside of your \/Arduino folder and then the IDE should open a sketch...duh!<br \/>\nSerial comms between PC and Uno should now work.<br \/>\nYou can find serial ports with python e.g:<br \/>\n<span style=\"color: #0000ff;\">python -m serial.tools.list_ports<\/span><br \/>\n<span style=\"color: #ff0000;\">\/dev\/ttyS0<\/span><br \/>\nPython has a miniterm too:<br \/>\n<span style=\"color: #0000ff;\">python -m serial.tools.miniterm \/dev\/ttyS0<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Miniterm on \/dev\/ttyS0 9600,8,N,1 ---<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---<\/span><br \/>\n<span style=\"color: #ff0000;\">--- pySerial (3.0.1) - miniterm - help<\/span><br \/>\n<span style=\"color: #ff0000;\">---<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Ctrl+] Exit program<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Ctrl+T Menu escape key, followed by:<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Menu keys:<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Ctrl+T Send the menu character itself to remote<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Ctrl+] Send the exit character itself to remote<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Ctrl+I Show info<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Ctrl+U Upload file (prompt will be shown)<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Ctrl+A encoding<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Ctrl+F edit filters<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Toggles:<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Ctrl+R RTS Ctrl+D DTR Ctrl+B BREAK<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Ctrl+E echo Ctrl+L EOL<\/span><br \/>\n<span style=\"color: #ff0000;\">---<\/span><br \/>\n<span style=\"color: #ff0000;\">--- Port settings (Ctrl+T followed by the following):<\/span><br \/>\n<span style=\"color: #ff0000;\">--- p change port<\/span><br \/>\n<span style=\"color: #ff0000;\">--- 7 8 set data bits<\/span><br \/>\n<span style=\"color: #ff0000;\">--- N E O S M change parity (None, Even, Odd, Space, Mark)<\/span><br \/>\n<span style=\"color: #ff0000;\">--- 1 2 3 set stop bits (1, 2, 1.5)<\/span><br \/>\n<span style=\"color: #ff0000;\">--- b change baud rate<\/span><br \/>\n<span style=\"color: #ff0000;\">--- x X disable\/enable software flow control<\/span><br \/>\n<span style=\"color: #ff0000;\">--- r R disable\/enable hardware flow contro<\/span>l<br \/>\nGet and unpack the latest linux 64 bit IDE files for from:<br \/>\n<a href=\"https:\/\/www.arduino.cc\/en\/Main\/Software\">https:\/\/www.arduino.cc\/en\/Main\/Software<\/a><br \/>\nAlso, in Preferences, set Show verbose output on uploading to help with errors...it shows a lot of info on upload:<br \/>\n<em><span style=\"color: #ff0000;\">Sketch uses 17410 bytes (56%) of program storage space. Maximum is 30720 bytes.<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Global variables use 1458 bytes (71%) of dynamic memory, leaving 590 bytes for local variables. Maximum is 2048 bytes.<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">\/home\/stevee\/arduino-1.8.9\/hardware\/tools\/avr\/bin\/avrdude -C\/home\/stevee\/arduino-1.8.9\/hardware\/tools\/avr\/etc\/avrdude.conf -v -patmega328p -carduino -P\/dev\/ttyUSB0 -b115200 -D -Uflash:w:\/tmp\/arduino_build_20487\/steve_station.ino.hex:i<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: Version 6.3-20171130<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Copyright (c) 2000-2005 Brian Dean, https:\/\/www.bdmicro.com\/<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Copyright (c) 2007-2014 Joerg Wunsch<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">System wide configuration file is \"\/home\/stevee\/arduino-1.8.9\/hardware\/tools\/avr\/etc\/avrdude.conf\"<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">User configuration file is \"\/home\/stevee\/.avrduderc\"<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">User configuration file does not exist or is not a regular file, skipping<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Using Port : \/dev\/ttyUSB0<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Using Programmer : arduino<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Overriding Baud Rate : 115200<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">AVR Part : ATmega328P<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Chip Erase delay : 9000 us<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">PAGEL : PD7<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">BS2 : PC2<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">RESET disposition : dedicated<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">RETRY pulse : SCK<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">serial program mode : yes<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">parallel program mode : yes<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Timeout : 200<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">StabDelay : 100<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">CmdexeDelay : 25<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">SyncLoops : 32<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">ByteDelay : 0<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">PollIndex : 3<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">PollValue : 0x53<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Memory Detail :<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Block Poll Page Polled<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Programmer Type : Arduino<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Description : Arduino<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Hardware Version: 3<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Firmware Version: 4.4<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Vtarget : 0.3 V<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Varef : 0.3 V<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Oscillator : 28.800 kHz<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">SCK period : 3.3 us<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: AVR device initialized and ready to accept instructions<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Reading | ################################################## | 100% 0.00s<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: Device signature = 0x1e950f (probably m328p)<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: reading input file \"\/tmp\/arduino_build_20487\/steve_station.ino.hex\"<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: writing flash (17410 bytes):<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Writing | ################################################## | 100% 2.88s<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: 17410 bytes of flash written<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: verifying flash memory against \/tmp\/arduino_build_20487\/steve_station.ino.hex:<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: load data flash data from input file \/tmp\/arduino_build_20487\/steve_station.ino.hex:<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: input file \/tmp\/arduino_build_20487\/steve_station.ino.hex contains 17410 bytes<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: reading on-chip flash data:<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">Reading | ################################################## | 100% 2.30s<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: verifying ...<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude: 17410 bytes of flash verified<\/span><\/em><br \/>\n<em><span style=\"color: #ff0000;\">avrdude done. Thank you.<\/span><\/em><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7878 aligncenter\" src=\"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-content\/uploads\/2019\/08\/unoweb-1024x549.png\" alt=\"\" width=\"840\" height=\"450\" \/><br \/>\nRun the arduino file as an exe to open the \"sketches\" window and explore the menus, set board model, serial ports, basic tutorials etc:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7886 aligncenter\" src=\"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-content\/uploads\/2019\/08\/folder-1-1024x648.png\" alt=\"\" width=\"840\" height=\"532\" \/><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7894 aligncenter\" src=\"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-content\/uploads\/2019\/08\/sketch1-1024x576.png\" alt=\"\" width=\"840\" height=\"473\" \/><br \/>\n<iframe loading=\"lazy\" title=\"Add serial port permission to user, on Ubuntu Linux.\" width=\"1778\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/mEptke-5rJc?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><br \/>\nhttps:\/\/www.circuitbasics.com\/arduino-thermistor-temperature-sensor-tutorial<br \/>\nhttps:\/\/www.circuitbasics.com\/how-to-set-up-an-lcd-display-on-an-arduino\/<br \/>\nCombine the two tutorials and code to make the temp display on the LCD screen...<br \/>\nI converted to deg C from F in the sketch window:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7880 aligncenter\" src=\"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-content\/uploads\/2019\/08\/thermistorLCD-1024x576.png\" alt=\"\" width=\"840\" height=\"473\" \/>if you have probs compiling, all these need to be exes:<br \/>\n<span style=\"color: #0000ff;\">chmod +x \/home\/stevee\/arduino-1.8.9\/hardware\/tools\/avr\/bin\/*<\/span><br \/>\n---------------------------------<\/p>\n<pre class=\"lang:default decode:true \">#include &lt;LiquidCrystal.h&gt;\r\nint ThermistorPin = 0;\r\nint Vo;\r\nfloat R1 = 10000;\r\nfloat logR2, R2, T;\r\nfloat c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;\r\nLiquidCrystal lcd(12, 11, 5, 4, 3, 2);\r\nvoid setup() {\r\nSerial.begin(9600);\r\n}\r\nvoid loop() {\r\nVo = analogRead(ThermistorPin);\r\nR2 = R1 * (1023.0 \/ (float)Vo - 1.0);\r\nlogR2 = log(R2);\r\nT = (1.0 \/ (c1 + c2*logR2 + c3*logR2*logR2*logR2));\r\nT = T - 273.15;\r\nT = (T * 9.0)\/ 5.0 + 32.0;\r\n\/\/conv C\r\nT = (T - 32) \/ 1.8;\r\nlcd.print(\"Temp = \");\r\nlcd.print(T);\r\nlcd.print(\" C\");\r\ndelay(5000);\r\nlcd.clear();\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>My 9.5V solar panel powers the Uno:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7901 aligncenter\" src=\"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-content\/uploads\/2019\/08\/solar95-1024x768.jpg\" alt=\"\" width=\"840\" height=\"630\" \/><br \/>\nThe same SDR module aerial will hopefully work with the ARCELI NEO-7M UBLOX GPS Satellite Positioning Module with SMA Antenna Interface.<br \/>\nMy LCD shows:<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-7902 aligncenter\" src=\"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-content\/uploads\/2019\/08\/tempc-1024x768.jpg\" alt=\"\" width=\"840\" height=\"630\" \/><br \/>\nI'm looking forward to the GPS project here:<br \/>\n<iframe loading=\"lazy\" title=\"Playing with GPS: Ublox Neo-7M and U-Center\" width=\"1778\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/I0RaJZbccqw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><br \/>\n<iframe loading=\"lazy\" title=\"Arduino Kit\" width=\"1333\" height=\"1000\" src=\"https:\/\/www.youtube.com\/embed\/-z5CVlyQTr8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I bought the Elegoo R3 Project Super Starter kit from Amazon, -\u00a330: What you get, more or less: In one evening I got the first basics done - A\/D converter-\u00a0 resistor, temp\/humidity sensor then the thermistor\/LCD projects. Very educational! sudo apt install arduino sudo tail -f \/var\/log\/syslog Plug in Arduino Uno R3 to printer cable <a href=\"https:\/\/stevepedwards.today\/ElectronicsStuff\/arduino-and-linux\/\" class=\"more-link\">...<span class=\"screen-reader-text\">  Arduino Intro on Linux Mint<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,2],"tags":[],"class_list":["post-7872","post","type-post","status-publish","format-standard","hentry","category-tech-studies","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-json\/wp\/v2\/posts\/7872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-json\/wp\/v2\/comments?post=7872"}],"version-history":[{"count":9,"href":"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-json\/wp\/v2\/posts\/7872\/revisions"}],"predecessor-version":[{"id":8959,"href":"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-json\/wp\/v2\/posts\/7872\/revisions\/8959"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-json\/wp\/v2\/media?parent=7872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-json\/wp\/v2\/categories?post=7872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/ElectronicsStuff\/wp-json\/wp\/v2\/tags?post=7872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}