Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, 4 July 2019

Had to get access to serial port with new 64-bit Ubuntu 18.04 OS

1
Your user account probably doesn't have permission to use the serial port.
Two ways to address this:
  • Easiest, but not advised: Run the Arduino IDE as root (eg launch from the command line using sudo).
  • The second, more advisable way to do it is to add your user to the dialout group, which has permission to use the serial port. Use the command sudo adduser $USER dialout. You will need to log out then log back in for it to take effect though (or try this). To list groups of current user use groups or id -Gn.
Once this is done, when you select the correct serial port (as others have mentioned maybe /dev/ttyUSB0) you should be able to write, allowing you to program the Arduino.

Saturday, 22 June 2019

Installing Arduino IDE on Linux

https://askubuntu.com/questions/786367/setting-up-arduino-uno-ide-on-ubuntu

I found I couldn't download over serial port Blink example to NodeMCU

kilnageer@kilnageer-Inspiron-3537:~$ dmesg | grep tty
[    0.000000] console [tty0] enabled
[ 9640.093642] usb 1-1.4: ch341-uart converter now attached to ttyUSB0
[10666.992832] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0


[10668.867323] usb 1-1.4: ch341-uart converter now attached to ttyUSB0
kilnageer@kilnageer-Inspiron-3537:~$ sudo adduser kilnageer dialout

Then logged out as Kilnageer and back in. Download then worked.

Had to include libraries PubSubClient for MQTT and adafruit unified sensor


https://lastminuteengineers.com/esp8266-dht11-dht22-web-server-tutorial/



http://www.steves-internet-guide.com/install-mosquitto-linux/

Installing The Mosquitto Broker

The download links and install directions for Linux are here.
I followed the install instructions for Ubuntu but they seemed to miss a few important steps. Here are the steps I used.
  • sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
  • sudo apt-get update
  • sudo apt-get install mosquitto
  • sudo apt-get install mosquitto-clients 

kilnageer@kilnageer-Inspiron-3537:~$ mosquitto_sub -h 192.168.1.100 -t \esp8266_2_arduino_out
{"micros":22966832,"counter":4}
{"micros":28040128,"counter":5}



Trouble with DHT22 though DHT11 works. May use code here to investigate:
https://www.keuwl.com/electronics/rduino/bluet/08-dht11/

Rather than Adafruit uni sensor library for DHTXX.

Also .cpp code available from here:
https://www.instructables.com/id/How-to-interface-Humidity-and-Temperature-DTH11-Se/
https://drive.google.com/file/d/0B1paTI5fzcHodno5azFOSVVDT0E/view?usp=sharing




Saturday, 15 June 2019

Installing Arduino IDE on Ubuntu Linux laptop

I went to https://www.arduino.cc/en/Main/Software

and then clicked on the Linux 64-bit download link

I then saved the arduino-1.8.9-linux64.tar.xz file to my downloads directory

kilnageer@kilnageer-Inspiron-3537:~/Downloads/arduino-1.8.9$ sudo ./install.sh
(which will set up a menu item for Arduino, etc.)

Can now see "Arduino IDE" under "Programming" menu item.

But it doesn't do anything..
Trying manually..
kilnageer@kilnageer-Inspiron-3537:~/Downloads/arduino-1.8.9$ ./arduino
./arduino: line 35: /home/kilnageer/Downloads/arduino-1.8.9/java/bin/java: cannot execute binary file: Exec format error

kilnageer@kilnageer-Inspiron-3537:~/Downloads/arduino-1.8.9$ java -version
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)

All due to having a 32-bit Ubuntu installed! "uname -m" reports this as "i686" rather than "x86_64"