Board Bring up for PLATFORM.IO code
The production version of the #FujiNet firmware is being written in Platform.IO. It brings together all of the formerly compartmentalized Arduino tests into a cohesive modular firmware. If you want to help work on it, you'll need to bring up this version of the code on your hardware.
The TNFSlib code currently targets the FS API that's present on the ESP32. The ESP8266 FS API is slightly different, and needs some help to get ported, so that the Platform.IO code can cleanly work on e.g. the Mars Bar hardware. If you can help, please read on to do the bring-up.
If you haven't already done so. Please install git, which is required to check out the code from the source code repository.
apt-get install git-core
or
apt-get install build-essential
Which also adds a bunch of useful things.
Under Windows, git can simply be installed from here: https://git-scm.com/download/win
I Highly suggest installing XCode, which will give you 'git', from the App Store.
Microsoft VS.Code is used as the IDE for Platform.IO, in contrast to the Arduino IDE. You can get a copy of it for Windows, Linux, or Mac.
As I was testing these instructions for Linux, I found that I had to install the following packages after installing VS.Code, due to only a limited Python environment being installed by default under Ubuntu based Linux distributions:
apt-get install python3-venv
apt-get install python3-distutils
Once you've installed VS.Code, you will need to run VS.Code and install Platform.IO from the following Link:
And let the resulting terminal window finish installing Platform.IO
Once the Reload Now button appears, press it.
Once Platform.IO is installed, a new tab should appear with PIO Home, with icons down its left side. Select Platforms. You should then select Embedded. You should then select one of the two platforms for #Fujinet:
- Espressif 8266 - for ESP8266 based boards (e.g. Mars Bar)
- Espressif 32 - for ESP32 based boards (e.g. the Ice cream Sandwich)
And press its install button.
You should then press CTRL-` (the backtick), to open a terminal and move to where you want your repository to be. If you haven't created a space for projects, you should make one. e.g.
mkdir Workspace
cd Workspace
If you are only planning to test, You should then clone the repository with the following git command:
git clone http://github.com/fujinetwifi/atariwifi.git
If you intend to contribute to this code, you should have an account on github.com. It is easy enough to make one, and it's free.
You should then have an SSH public key associated with your account that matches the one used by VS.Code. If there isn't one yet, you can run the following program, to generate one:
ssh-keygen
And then view the contents of the file it generated:
cat ~/.ssh/id_rsa.pub
Copy the contents to th clipboard. Go to your account settings, select SSH Keys, and add the key you just copied into the clipboard there.
You can then check out the code with the following command:
git clone git@github.com:fujinetwifi/atariwifi.git
Finally, use Open Workspace in the File menu and navigate to the atariwifi/platformio/FujiNet folder, and select the fujinet.code-workspace. It will open as a VS.Code workspace.
You should now see "FUJINET (WORKSPACE)" in the Explorer, with various lib/ src/ include/ folders...
For some features, such as Network Debugging, we need to know the SSID and PASSWORD of the network ahead of time. For this, a file inside include/ called ssid.h must be created, containing the following content:
#define WIFI_SSID "YourNetworkSSID"
#define WIFI_PASS "YourNetworkPassword"
Save the file. It will not be checked into version control, as it has been explicitly excluded in git.
The latest FujiNet hardware contains the ESP32 WROVER module which has a slightly different pinout than the previously used WROOM module. IF you have the WROVER module you must modify the ESP32 PlatformIO core. Open the file your-platformio-dir/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.cpp
with a text editor and near the top change #define RX2
to 33 and #define TX2
to 21.
Select the Explorer tab,and select the platformio.ini file.
Uncomment the appropriate [env:nodemcuv2] or [env:esp32] section. Alter the upload_port and monitor_port values. If using the WROVER module you should use the 16MB partition layout and uncomment the SPIRAM / PSRAM lines
[env:esp32]
platform = espressif32
build_type = debug
board = fujinet_board
framework = arduino
build_flags =
;-D JTAG
-D ESP_32
-D DEBUG_S
-D BUG_UART=Serial
-D DEBUG_SPEED=921600
;-D BLUETOOTH_SUPPORT
;-D BOARD_HAS_PSRAM
;-D CONFIG_SPIRAM_CACHE_WORKAROUND
;-mfix-esp32-psram-cache-issue
;board_build.partitions = fujinet_partitions_16MB.csv
board_build.partitions = fujinet_partitions_4MB.csv
upload_port = COM3
upload_speed = 921600
monitor_port = COM3
monitor_speed = 921600
lib_ldf_mode = deep+
Select the Platform.IO tab (it looks like an alien head, add picture.), and press Build.
Select the Upload task to upload the firmware to your board.
Once this finishes, select the Upload File System Image task to upload the SPIFFS image to your board.
Once this is done, you should be able to boot your #FujiNet from your Atari.