User Tools

Site Tools


oak:tutorials:serialupdate

This is an old revision of the document!


Loading the first update over serial

NOTE: This is intended only for updating an Oak via Serial for the first update, when the standard update over WiFi has failed.

You must use a 3.3V Uart to USB adapter - or - an Arduino (see here for specific and important connection info about using an Arduino: http://digistump.com/wiki/oak/tutorials/serial_through_arduino)

Configuring your computer

Linux or OS X: In order to talk to the Oak over Serial, you may need two pieces of software installed (in addition to the Arduino IDE with appropriate Oak board support). The first is Python, and the second is the PySerial module for python. It is very likely Python is already installed. You will also need to install the PySerial library to allow communication with the Oak.

Windows: Use the exe provided and you do not need to install any other software.

OS X and Linux: Install PySerial

Regardless of your operating system, it is fairly likely you will need to install PySerial, which allows Python to access your computers serial ports. You can start by downloading it from https://pypi.python.org/pypi/pyserial. - you will need the source file (pyserial-3.0.1.tar.gz at the time of writing).

Then open a Terminal session, 'cd' to wherever you downloaded pyserial-3.0.1.tar.gz and then issue the following command to unpack the installation folder.

tar -xzf pyserial-3.0.1.tar.gz

Then “cd” into the pyserial-3.0.1 folder, then run the command:

sudo python setup.py install

You should then be configuring things!

Connecting Your Oak

To program your Oak over serial, you will want to connect the GND of your USB-Serial Adapter to the Oak's GND, RX to TX, TX to RX, and P2 (on the Oak) to GND (on the Oak). You can then power the Oak via the on-board Micro USB slot, or by providing appropriate power to the VIN or VCC pins.

Adapter     Oak
---------------
GND     ->  GND
RX      ->  TX
TX      ->  RX
VCC     ->  VIN/VCC (only if not powered over USB)
            P2 -> GND

Needs pic of an adapter here, and some more detailed explanation of pin connections

Downloading the Programmer Script and Lastest Update

Download the latest firmware image here: https://digistump.com/firmware_v1.bin

wget https://digistump.com/firmware_v1.bin

Download the latest programming script here: https://github.com/digistump/OakRestore/archive/master.zip

Unzip and put the firmware_v1.bin in the same folder.

OS X or Linux run the following command (may need to add sudo):

python esptool.py --baud 115200 --port YOUR_COM_PORT write_flash -fs 32m 0x1000 blank.bin 0x2000 firmware_v1.bin 0x101000 blank.bin 0x102000 blank.bin 0x202000 blank.bin 

on Windows:

esptool --baud 115200 --port YOUR_COM_PORT write_flash -fs 32m 0x1000 blank.bin 0x2000 firmware_v1.bin 0x101000 blank.bin 0x102000 blank.bin 0x202000 blank.bin 

You should see something like this:

Connecting...
Erasing flash...
Writing at 0x00002000... (0 %)
Writing at 0x00002400... (0 %)
Writing at 0x00002800... (1 %)

And when complete without error you should see bursts of three blinks from the LED on the Oak, which means you are now running the latest update. Now proceed to this tutorial, but the Oak will know not to download the update so it will skip those steps in the config app: http://digistump.com/wiki/oak/tutorials/connecting

Troubleshooting

Failed to connect to ESP8266

Failing to power, connect the serial TX & RX pins, or ground the P2 pin can result in the following error message.

Connecting...

A fatal error occurred: Failed to connect to ESP8266
oak/tutorials/serialupdate.1501627097.txt.gz · Last modified: 2017/08/01 15:38 by digistump