If anyone has an inkling to build the firmware with PlatformIO, I have made some basic instructions here that does’t use command line.
I had a raft of issues getting it to build the first time so I would be interested if others could provide some feedback on the process before I submit to the main repo.
Some observations from a first time Windows 10 user of Visual Studio and Platformio.
You should install Python and reboot before trying to install the Platformio extension.
I also needed to install Git and close Visual Studio and reopen it to be successful.
To get a clean build I have had to delete the auto-generated file ./.vscode/c_cpp_properties.json, close and re-open Visual Studio and WAIT until the file is auto-generated before compiling again.
Now I just need to wait for the hardware to arrive…
I also need to find where the version number is stored in the code so that I can confirm that I am using the latest code. I believe that the current version is stored in ./bin/version.sh
My biggest advice is to be patient and wait on platformio to finish what it is doing. I find that it takes 30 seconds for things to finish loading while it does not always tell you that it is still working on something.
I got my t-beam 1.1 yesterday and flashed both today using platform.io following the short write-up. I could add a few things like “wait for a few minutes for the build” which seems like a long time considering I’m using a beefy Mac. I guess I’m used to interpreted languages these days - instant gratification!
I have to say the platform.io integration to Visual Studio is really slick and being able to upload and monitor the logs (even though I don’t know anything about arduino) is very nice!
Great notes, I now remember those headaches I had! Clearing the .JSON file you found could be handy for some. Are you able to update the Github or would you mind if I did?
./bin/version.sh is the only version reference I was able to find as well.
Hmm, I have them installed due to work development activities with both Python and Git. The only thing I installed was platform.io then VScode (as I normally use Jetbrains’ Pycharm).
In this case it wasn’t a completely clean install.
@geeksville it seems that we should be able to select in the platformio.ini file the:
Hardware type
Country
Frequency
Display type
Meshtastic function (client, repeater, etc)
If that is possible point me to the correct format and I will attempt to make the platformio.ini file a little more descriptive and update the file on github.
@lux sure thing, they currently come from environment variables, but if you want to change them in the file you can change them on these lines:
A pull-request to improve the internal documentation in this file would be great,
Frequency currently comes from country and I’m not sure it really needs to be different, but if you want something nonstandard you can change MeshRadio.h
You set them with environment variables. For instance (on linux or OS-X, I’m not sure of the windows syntax):
export COUNTRY=CN (or EU865 or whatever)
Then in that same shell run platform io and do a build. That’s why platformio.ini looks like this on line 36:
-DHW_VERSION_${sysenv.COUNTRY}
It is using a special “sysenv” function to ask for the COUNTRY environment variable and then passing that into the C compiler as -DHW_VERSION_CN (or whatever)