Arduino IDE board settings: ESP8266 vs ATmega328

I’m working on a couple of different project, one using the ATmega328 and another using the ESP8266 (programming the Oracle Code card which I talked about here).

Just so I don’t forget what settings to use with each board, leaving a note here for reference.

IDE settings for ATmega328:

IDE settings for ESP8266 – from https://github.com/cameronsenese/codecard/tree/master/arduino :

Under Tools set the following settings:

  • Board: “Generic ESP8266 Module”
  • Upload Speed “115200”
  • CPU Frequency: “80 MHz”
  • Crystal Frequency: “26 MHz”
  • Flash Size: “4M (3M SPIFFS)”
  • Flash Mode: “DIO”
  • Flash Frequency: “40MHz”
  • Reset Method: “nodemcu”
  • Debug port: “Disabled”
  • Debug Level: “None”
  • IwIP Variant: “v2 Lower Memory”
  • VTables: “Flash”
  • Builtin Led: “2”
  • Erase Flash: “Only Sketch”
  • Port: This is the port that shows up once you turn on the CodeCard and press a button
  • Programmer: “ArduinoISP”

Not all USB cables are equal: Arduino IDE not seeing Arduino Nano

I have an Arduino Sketch to upload to an Arduino Nano. Connecting the Nano to my MacBook Pro, the power led lights up and the ‘sketch upload’ led is flashing. In the Arduino IDE however, the Nano is not visible under the Port menu. Reading around online, this could either be that the FTDI drivers are not installed or something wrong with the cable.

Given that the cable that cable with my Nano is rather thin, I remember reading elsewhere that there is such a thing as a ‘charge only’ usb cable. They’re thinner because they’re only wired with the power wires and are missing the data wires.

Changing this cable for another thicker cable, now the Arduino is recognized as expected in Arduino IDE under the Port menu. Swapping between the thinner USB cable and the thicker cable confirmed the thinner cable doesn’t work for a data connection.

Reprogramming and flashing the Oracle Code Card from Oracle World/Code One

I don’t know why I didn’t realize this sooner or even bother to check, but the ‘Code Card’ with the e-ink screen that was given away at Oracle World a couple of years ago for an interactive lab has a ESP8266 chip on it that can be flashed with new code using a USB cable and the Arduino IDE.

The original repo for the Arduino source for the card has unfortunately had the source for the card removed, but luckily there’s a fork that still has the code, here.

There’s notes in the Arduino folder about flashing the card. These mostly worked for me apart from I found this sequence worked best:

  • connect the card to your pc with a USB cable
  • power on the card with the switch on the side
  • hold the A button, don’t let go (this is important)
  • if you have the serial tool window open in the Arduino IDE you’ll see the messages per the docs
  • Start the Upload of your new code
  • When the upload is connected and starts uploading, then you can let go of the A button

There’s a post with some more details here.

Deploying to ESP8266 with Arduino IDE on MacOS error: “pyserial or esptool directories not found next to this upload.py tool”

If you see this error deploying to an ESP8266 from Arduino IDE on MacOS 11.2

"pyserial or esptool directories not found next to this upload.py tool"

… per this post, edit the file:

~/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/tools/list_ports_osx.py

Comment out lines 29 and 30 and append these lines:
   iokit = ctypes.cdll.LoadLibrary(‘/System/Library/Frameworks/IOKit.framework/IOKit’)
   cf = ctypes.cdll.LoadLibrary(‘/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation’)