From 6250b495387ac0509bfbbede839bc6f1b88bf2f8 Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 29 Nov 2019 20:13:27 +0100 Subject: [PATCH] Update Readme and app compile_mcu script --- README.org | 22 +++++++++++++++++++++- compile_mcu.sh | 9 +++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100755 compile_mcu.sh diff --git a/README.org b/README.org index b3f4549..265460c 100644 --- a/README.org +++ b/README.org @@ -25,4 +25,24 @@ cat /dev/ttyACM0 #+END_SRC - If you get a /Permission denied/, try running the command as a superuser (e.g. *sudo*) + If you get a /Permission denied/, you have to add your user to the group of the serial port (in this case /dev/ttyACM0). + + To check the group of the device: + +#+BEGIN_SRC sh + ls -la /dev/ttyACM0 +#+END_SRC + + Then add your user to the group (in this case the group is dialout and the user is user) + +#+BEGIN_SRC sh + sudo usermod -aG dialout user +#+END_SRC + +** ESP8266 + + During the *Week 4*, we used the NodeMCU instead of the Arduino uno, in this case to compile and upload the sketch (in this case we'll use the sketch Test): + +#+BEGIN_SRC sh + ./compile_mcu.sh Test +#+END_SRC diff --git a/compile_mcu.sh b/compile_mcu.sh new file mode 100755 index 0000000..2730fb4 --- /dev/null +++ b/compile_mcu.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo "Usage: compile.sh " +fi + +project=$1 + +arduino-cli compile --fqbn esp8266:esp8266:nodemcuv2 "$project" && arduino-cli upload -p /dev/ttyUSB0 --fqbn esp8266:esp8266:nodemcuv2 "$project"