PlatformIO Community

PlatformIO on freeBSD

Hello,

I’m looking for some guide or help for installing platformIO or more precisely some toolchain on freeBSD.

I’m using the freeNAS plugin for ESPHome.

freeNAS version : 11.3-U4.1
ESPHome version: 1.15.2
PlatformIO version: 4.3.4

The ESPHome plugin is correctly installed but when i try to compile, i got an error while installing xtensa:
image

i know there is a topic on this but they are dated from 2016 and read that was fixed so I think that I do something bad.

Thanks for help !

PlatformIO does indeed have the toolchain-xtensa package for the freebsd-amd64 architecture listed in the bintray, the latest version bing 3445d11-toolchain-xtensa-freebsd_amd64-1.40802.0.

But I think there’s a versioning error. The platform demands

But the available package version is only 1.40802.0, so that’s one less in the major and the minor doesn’t match, too…

Does the following work?

Thanks for the fast answer but it dosn’t work. I had a new error “permission denied” on package_json but when i put the good right. i got the usual error

o_O weird. That file should have normal rw permissons coming from the tar gz. I will setup a virtual machine and check whether this doesn’t work personally.

plz ask if you need some screen or information from my conf

I’ve just personally verified that this works. Installed a clean FreeBSD 12.1. Then had to install Gnome3 as desktop environment, sudo, python3, pip-3.7 and PlatformIO through pip. In a shell from the home directory, I did

wget https://bintray.com/platformio/tool-packages/download_file?file_path=3445d11-toolchain-xtensa-freebsd_amd64-1.40802.0.tar.gz
mv download_file\?file_path\=3445d11-toolchain-xtensa-freebsd_amd64-1.40802.0.tar.gz xtensa.tar.gz
cd ~/.platformio/packages/
mkdir toolchain-xtensa
mv ~/xtensa.tar.gz toolchain-xtensa/.
cd toolchain-xtensa/
tar xfv xtensa.tar.gz
nano package.json
<edit version to 2.40802.200502>

and created a new project

mkdir esp8266-test && cd esp8266-test
pio init -b nodemcuv2
nano src/main.cpp
<insert blinky sketch>
pio run

…which made me run into an error that libstdc++.so.6 wasn’t installed. This is solved incidentally by installing GCC. After a sudo pkg install gcc and a rerun of pio run:

[max@freebsd ~/esp8266-test]$ pio run 
Processing nodemcuv2 (platform: espressif8266; board: nodemcuv2; framework: arduino)
-----------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 (2.6.2) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.409.0 (4.9) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.191122 (4.8.2)
Building .pio/build/nodemcuv2/firmware.bin
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [===       ]  32.7% (used 26776 bytes from 81920 bytes)
Flash: [==        ]  24.6% (used 256844 bytes from 1044464 bytes)
Creating BIN file ".pio/build/nodemcuv2/firmware.bin" using "/usr/home/max/.platformio/packages/framework-arduinoespressif8266/bootloaders/eboot/eboot.elf" and ".pio/build/nodemcuv2/firmware.elf"
======================== [SUCCESS] Took 6.13 seconds ========================

So this trick works for me.

Maybe retry my steps and make sure you’ve edit all the right files and versions.

Note that the missing packet was also noticed by others who engineered workarounds like https://github.com/trombik/platformio-freebsd-toolchain-xtensa#rationale, which relies on a pre-installed system-wide install xtensa-lx106-elf and symlinks it in the package directory.

Okay thanks a lot the first reply you made works but I was namin toolchain-xtensa32 and not toolchain-xtensa. Thanks for help and sorry for the trouble. I got others issues but will try to find some solutions first :slight_smile:
Thanks for your time

Feel free to open new topics if there are additional tools missing for FreeBSD. Missing support packages or versioning mistakes seemed to happen there.

Sure juste looking on internet if solution doesn’t exist first

Just if someone use the fix that @maxgerhardt gave be sure that you have the good right on the platformio packages folder with : chown {USER} path/to/.platformio/packages
it’s all working for me now thanks for all