tinkering with the meshtastic build stuff
These are my (mostly) raw notes taken while figuring out how to flash, for a more digestible version, see the writeup.
notes
In order to build, I needed something called T383838platformio.
nix-shell -p platformio
Next, I had to edit the T383838platformio.ini file so that it would target my board.
I just put the T383838default_envs under T383838[platformio] to T383838t-deck based on the T383838.json files I saw in the T383838boards sub-directory.
So now the top of my T383838platformio.ini looks like this:
T282828
Tff7b72[platformio]
Te6edf3default_envs Tff7b72= Ta5d6fft-deck
T8b949e;default_envs = tbeam
Te6edf3…
Then I was able to kick things off:
T282828
platformio run
The much abbreviated output will look something like this:
[stephen@sasahi:~/firmware]$ platformio run
Processing t-deck (board: t-deck; platform: platformio/espressi
f32@6.7.0; framework: arduino)
Tool Manager: Installing espressif/toolchain-xtensa-esp32s3 @ 8
.4.0+2021r2-patch5
Downloading [#####-------------------------------] 16% 00:0
…snip…
Wrote 0x1e66c0 bytes to file /home/stephen/firmware/.pio/build/t-deck/f
irmware.factory.bin, ready to flash to offset 0x0
==================== [SUCCESS] Took 192.52 seconds ====================
Environment Status Duration
------------- -------- ------------
t-deck SUCCESS 00:03:12.524
===================== 1 succeeded in 00:03:12.524 =====================
So it looks like it compiled into a single file:
/home/stephen/firmware/.pio/build/t-deck/firmware.bin
Next, I wanted to upload it.
Just a bunch of guessing from staring at T383838platformio help I saw, T383838device was a command.
So I listed the devices:
platformio device --list
[stephen@sasahi:~/firmware]$ platformio device
Usage: platformio device [OPTIONS] COMMAND [ARGS]...
Options:
-h, --help Show this message and exit.
Commands:
list List devices
monitor Monitor device (Serial/Socket)
[stephen@sasahi:~/firmware]$ platformio device monitor -h
Usage: platformio device monitor [OPTIONS]
Options:
-p, --port TEXT Port, a number or a device name
-b, --baud INTEGER Set baud/speed [default=9600]
--parity [N|E|O|S|M] Enable parity checking [default=N]
--rtscts Enable RTS/CTS flow control
--xonxoff Enable software flow control
--rts INTEGER RANGE Set initial RTS line state [0<=x<=1]
--dtr INTEGER RANGE Set initial DTR line state [0<=x<=1]
--echo Enable local echo
--encoding TEXT Set the encoding for the serial port
(e.g. hexlify, Latin1, UTF-8)
[default=UTF-8]
-f, --filter TEXT Apply filters/text transformations
--eol [CR|LF|CRLF] End of line mode [default=CRLF]
--raw Disable encodings/transformations of
device output
--exit-char INTEGER ASCII code of special character that is
used to exit the application [default=3
(Ctrl+C)] [default: 3]
--menu-char INTEGER ASCII code of special character that is
used to control terminal (menu)
[default=20 (DEC)]
--quiet Diagnostics: suppress non-error messages
--no-reconnect Disable automatic reconnection if the
established connection fails
-d, --project-dir DIRECTORY
-e, --environment TEXT Load configuration from T383838platformio.ini
and the specified environment
-h, --help Show this message and exit.
[stephen@sasahi:~/firmware]$ platformio device monitor -p /dev/ttyACM0
Please build project in debug configuration to get more details about an
exception.
See https://docs.platformio.org/page/projectconf/build_configurations.htm
l
--- Terminal on /dev/ttyACM0 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default,
direct, esp32c3exceptiondecoder, esp32exception_decoder, hexlify, lo
g2file, nocontrol, printable, sendonenter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
--- File to upload: .pio/build/t-deck/firmware.bin
--- Sending file .pio/build/t-deck/firmware.bin ---
^@....................................................................................
......................................................................................
......................................................................................
......................................................................................
......................................................................................
......................................................................................
......................................................................................
......................................................................................
......................................................................................
......................................................................................
......................................................................................
......................................................................................
......................................................................................
......................................................................................
.....................................................................Disconnected ((5,
'Input/output error'))
Reconnecting to /dev/ttyACM0
Please build project in debug configuration to get more details about an exception.
See https://docs.platformio.org/page/projectconf/build_configurations.html
Connected!
��@INFO | ??:??:?? 0
//\ E S H T /\ S T / C
INFO | ??:??:?? 0 Booted, wake cause 0 (boot count 1), reset_reason=reset
DEBUG | ??:??:?? 1 Filesystem files (499712/1048576 Bytes):
DEBUG | ??:??:?? 1 /prefs/channels.proto (94 Bytes)
DEBUG | ??:??:?? 1 /prefs/config.proto (97 Bytes)
DEBUG | ??:??:?? 1 /prefs/db.proto (553 Bytes)
DEBUG | ??:??:?? 1 /prefs/module.proto (111 Bytes)
DEBUG | ??:??:?? 1 /static/.gitkeep (0 Bytes)
DEBUG | ??:??:?? 1 /static/Logo_Black.svg.gz (602 Bytes)
DEBUG | ??:??:?? 1 /static/Logo_White.svg.gz (610 Bytes)
DEBUG | ??:??:?? 1 /static/apple-touch-icon.png.gz (3164 Bytes)
<snip> <snip>
After issues with the flashing...
There's a convenient script for doing the flashing. Make sure it's in flash mode, then:
T282828
./bin/device-install.sh -p /dev/ttyACM0 -f .pio/build/t-deck/firmware.bin
The output will look a lot like the web flasher output.
Looks like I'm missing some bin files it wants to push.
There's a convenient script for doing the flashing. Make sure it's in flash mode, then:
T282828
./bin/device-install.sh -p /dev/ttyACM0 -f .pio/build/t-deck/firmware.bin
The output will look a lot like the web flasher output.
The script looks for files that are not built by this project.
I tried to use the T383838firmware-ota repo, but despite making a venv, it was trying to pip install deps to the operating system instead of my venv.
On the discord I spotted a note about the buildfs target for platformio, which built the littlefs.bin that's sort of referenced by the script. I had to rename it so it would fit the file pattern :-/
After a whole bunch more fighting.... I realized I missed something important in the output.
Wrote 0x1e66c0 bytes to file /home/stephen/firmware/.pio/build/t-deck/f
irmware.factory.bin, ready to flash to offset 0x0
So I've been trying to flash the wrong image.
But through all the running around, at least I've found the tool for the flashing -- esptool. And a bunch of additional dependencies.
Note:
nix-shell -p platformio esptool python3Packages.pip pkg-config python3Packages.protobuf python3Packages.grpcio python3Packages.grpcio-tools
Flashing command:
esptool.py write_flash 0x00 .pio/build/t-deck/firmware.factory.bin
Tags: raw, cli, meshtastic
Tags
Navigation
Backlinks