Board Bring up Software - FujiNetWIFI/fujinet-firmware GitHub Wiki
Nov 2023 - simplified doc, dropped references to PIO 3.x
This document links to instructions for steps needed to build, modify and deploy the FujiNet project onto the ESP32 system that is the heart of the FujiNet Hardware Device. Even if you are builing a raw devkit with an ESP32 dev board Board Bring Up Hardware or if you are using a retail FuijNet purchased from one of the many vendors selling them, you will have to build the same project and upload it to your device.
You can build new versions of FujiNet firmware on:
- Linux
- macOS
- Windows (using WSL - on raw Windows is not recommended)
This is the one to read:
- To setup and use with the new 6x PIO - pio 6 x howto
- If you want to skip using an IDE (Visual Studio Code) and just install from a UNIX shell, go to The Complete Linux CLI Guide
Tired of waiting for VSCode to do unimaginable things with PIO and waste cycles of your CPU and your brain? If so just run build with the nice build script included with every git clone! The script was created by Mark J. Fisher back in Dec. 2022. Thanks Mark!
start a terminal; go to your repo
$ export PATH=$PATH:$HOME/.platformio/penv/bin
$ ./build.sh -um
Above is the absolute minimum to build a Firmware image and flash. PIO will detect any file changes and compile/build as required. You can see from the full set of commands below that you can build without flashing as well as flash the UI (filesystem) when required. If you are using these commands it's best to not have VSCode running at the same time as there will be contention with files. The same goes with the FujiNet-Flasher app- don't run it at the same time you are using these commands to monitor the output via USB or there will be device contention.
$ ./build.sh -h
Usage: build.sh [-b|-e ENV|-c|-m|-x|-t TARGET|-h]
-b # run build
-c # run clean before build
-d # add dev flag to build
-m # run monitor after build
-u # upload image (device code)
-f # upload filesystem (webUI etc)
-x # exclude dep graph output from logging
-e ENV # use specific environment
-t TGT # run target task (default of none means do build, but -b must be specified
-h # this help
Of course these commands assume you have configured your platformio configuration setup for a target and have the proper usb device set for your local system. These will not work with the default sample ini file.
If you just clone the repo and try to build you will see this:
(master) $ ./build.sh -b
NotPlatformIOProjectError: Not a PlatformIO project. `platformio.ini` file has not been found in current working directory (/Volumes/512M2/code/fujinet-platformio). To initialize new project please use `platformio project init` command
Do not run the platformio project init
command--- just copy the sample file over to a fresh ini:
(master) $ cp platformio-sample.ini platformio.ini
Now edit the platformio.ini file as described here in the wiki guides; set a target and set your USB device.
To find out which /dev/ device macOS is using for the FujiNet ensure you have plugged in the FN to the Mac via USB. Then this command will show you:
dillera@trashcan $ ls /dev/tty* | grep usb
/dev/tty.usbserial-401310
In my case I use /dev/tty.usbserial-401310
in my platformio.ini file...
For more USB info about the plugged in FujiNet device on your USB chain use this command:
$ system_profiler SPUSBDataType | grep -A9 CP2102N
2023-07-31 10:53:51.248 system_profiler[28665:24273481] SPUSBDevice: IOCreatePlugInInterfaceForService failed 0xe00002be
2023-07-31 10:53:51.250 system_profiler[28665:24273481] SPUSBDevice: IOCreatePlugInInterfaceForService failed 0xe00002be
CP2102N USB to UART Bridge Controller:
Product ID: 0xea60
Vendor ID: 0x10c4 (Silicon Laboratories, Inc.)
Version: 1.00
Serial Number: 34c18b88ce7beb118bf97f4ce21b18bc
Speed: Up to 12 Mb/s
Manufacturer: Silicon Labs
Location ID: 0x40131000 / 6
Current Available (mA): 500
The FN is the Silicon Labs device.