Github Devices Community Docs Blog

OpenMQTTGateway v0.9.2 build error on WIN 10 x64

Hi, this is my platform :

WIN 10 EN 64bit
PlatformIO v.2.3.3 Core v.4.0.3 
on Visual Studio CODE v.1.38.1 

Executing task:

C:\Users\Claudio.platformio\penv\Scripts\platformio.exe run

I have this error :

Processing nodemcuv2-rf (platform: espressif8266@1.8.0 ; 2.4.2; board: nodemcuv2; framework: arduino)
PlatformManager: Installing espressif8266 @ 1.8.0 ; 2.4.2
Warning! Package Mirror: Package version 2.2.3 doesn’t satisfy requirements 1.8.0 ; 2.4.2
Looking for another mirror…
Error: Could not install ‘espressif8266’ with version requirements ‘1.8.0 ; 2.4.2’ for your system ‘windows_x86’.

Can you help me to solve this problem, and also what mean the ; (semicolon) between version of espressif8266?

Installing espressif8266 @ 1.8.0 ; 2.4.2

Thanks

Hi,

Semicolon is just to indicate the begining of a comment. If it is not taken as a comment you can remove it and aldo what you have after it. Nevertheless this is strange. Could you post your platformio.ini ?

Hi, thanks for your reply.

Below is my platformio.ini, it is the same of branch master v.0.9.2, except that uncommented line
default_envs = nodemcuv2-rf

I already knew the use of semicolons, but it seems that the semicolon in the [com] section is not interpreted well, at least in my Windows 10 system.

However, if I only put expressif8266@1.8.0, this happens:

Processing nodemcuv2-rf (platform: espressif8266@1.8.0; 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 1.8.0 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 1.40802.0 (4.8.2), framework-arduinoespressif8266 2.20402.4 (2.4.2), tool-esptool 1.413.0 (4.13)
UnicodeEncodeError: 'charmap' codec can't encode character '\x81' in position 38873: character maps to <undefined>:        
  File "C:\users\claudio\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 126:
    env.SConscript("$BUILD_SCRIPT")
  File "C:\Users\Claudio\.platformio\packages\tool-scons\script\..\engine\SCons\Script\SConscript.py", line 605:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\Claudio\.platformio\packages\tool-scons\script\..\engine\SCons\Script\SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\users\claudio\.platformio\platforms\espressif8266@1.8.0\builder\main.py", line 316:
    target_elf = env.BuildProgram()
  File "C:\Users\Claudio\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:      
    return self.method(*nargs, **kwargs)
  File "C:\users\claudio\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 110:  
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "C:\Users\Claudio\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:      
    return self.method(*nargs, **kwargs)
  File "C:\users\claudio\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 288:
    env.ConvertInoToCpp()
  File "C:\Users\Claudio\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:
    return self.method(*nargs, **kwargs)
  File "C:\users\claudio\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 198:
    out_file = c.convert(ino_nodes)
  File "C:\users\claudio\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 57:
    return self.process(contents)
  File "C:\users\claudio\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 80:
    assert self._gcc_preprocess(contents, out_file)
  File "C:\users\claudio\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 90:
    fp.write(contents)
  File "c:\users\claudio\.platformio\penv\lib\encodings\cp1252.py", line 19:
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]

Instead, if I insert only 2.4.2 this happens:

Processing nodemcuv2-rf (platform: espressif8266@2.4.2; board: nodemcuv2; framework: arduino)

PlatformManager: Installing espressif8266 @ 2.4.2
Error: Could not find a version that satisfies the requirement ‘2.4.2’ for your system 'windows_x86’

(Very strange this “windows_x86” message, because my system is surely WIN64.)

So, how can I compile OMG?

Many thanks and regards

Claudio

; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = main
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ENVIRONMENT CHOICE ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Uncomment the env line corresponding to your board and modules required, ;
;you can also adapt the modules by removing the corresponding lines in the env detail ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;default_envs = rfbridge
;default_envs = esp32dev-all
;default_envs = esp32dev-rf
;default_envs = esp32dev-ir
;default_envs = esp32dev-ble
;default_envs = ttgo-lora32-v1
default_envs = nodemcuv2-rf
;default_envs = nodemcuv2-ir
;default_envs = nodemcuv2-ble
;default_envs = nodemcuv2-all
;default_envs = uno-rf
;default_envs = uno-fastled
;default_envs = atmega-all

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ENVIRONMENTS PARAMETERS ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Libraries and parameters shared accross environements ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[libraries]
arduinojson = ArduinoJson@5.13.4
pubsubclient = PubSubClient@2.7
rc-switch = 1technophile/rc-switch#90adb34
newremoteswitch = 1technophile/NewRemoteSwitch#8eb980e
ble = eos1d3/ESP32_BLE#9d6c1ed
irremoteesp = IRremoteESP8266@2.6.3
irremote = IRremote
lora = sandeepmistry/arduino-LoRa#f4a1d27
esppilight = ESPiLight@0.16.0
rfm69 = RFM69@4a6f77ad47
dht = DHT sensor library@1.3.0
unifiedsensor = Adafruit Unified Sensor@1.0.2
tsl2561 = Adafruit TSL2561@1.0.3
bme280 = SparkFun BME280@2.0.4
bmp180 = BMP180@efac46bd8d
ina226 = jarzebski/Arduino-INA226#968a684
a6lib = 1technophile/A6lib
wifimanager = tzapu/WiFiManager#c3ff582
ethernet = Ethernet
esp8266_mdns = esp8266_mdns
wire = Wire
fastled = FastLED

[env]
framework = arduino
lib_deps =
${libraries.pubsubclient}
${libraries.arduinojson}
build_flags =
-w ; supress all warnings
‘-DjsonPublishing=true’
‘-DjsonReceiving=true’
monitor_speed = 115200

[com]
esp8266_platform = espressif8266@1.8.0 ; 2.4.2
esp32_platform = espressif32@1.9.0
atmelavr_platform = atmelavr@1.13.0

[com-esp]
lib_deps =
${env.lib_deps}
${libraries.wifimanager}
build_flags =
${env.build_flags}
-DMQTT_MAX_PACKET_SIZE=1024
‘-DsimpleReceiving=true’
‘-DsimplePublishing=true’
‘-DZmqttDiscovery=“HADiscovery”’
‘-DTRACE=1’

[com-arduino]
lib_deps =
${env.lib_deps}
${libraries.ethernet}
build_flags =
${env.build_flags}
-DMQTT_MAX_PACKET_SIZE=1024
‘-DsimpleReceiving=true’
‘-DsimplePublishing=true’
‘-DZmqttDiscovery=“HADiscovery”’
‘-DTRACE=1’

[com-arduino-low-memory]
lib_deps =
${env.lib_deps}
${libraries.ethernet}
build_flags =
${env.build_flags}
-DMQTT_MAX_PACKET_SIZE=128

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ENVIRONMENTS LIST ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;List of environments that can be build ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[env:rfbridge]
platform = ${com.esp8266_platform}
board = esp8285
lib_deps =
${com-esp.lib_deps}
${libraries.esp8266_mdns}
build_flags =
${com-esp.build_flags}
‘-DZgatewaySRFB=“SRFB”’
‘-DGateway_Name=“OpenMQTTGateway_SRFB”’
board_build.flash_mode = dout

[env:esp32dev-all]
platform = ${com.esp32_platform}
board = esp32dev
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp.lib_deps}
${libraries.ble}
${libraries.irremoteesp}
${libraries.lora}
${libraries.rfm69}
${libraries.rc-switch}
${libraries.newremoteswitch}
${libraries.bme280}
${libraries.bmp180}
${libraries.unifiedsensor}
${libraries.dht}
${libraries.tsl2561}
${libraries.ina226}
${libraries.fastled}
build_flags =
${com-esp.build_flags}
‘-DZgatewayRF=“RF”’
‘-DZgatewayLORA=“LORA”’
‘-DZgatewayRF2=“RF2”’
‘-DZgatewayIR=“IR”’
‘-DZgatewayBT=“BT”’
‘-DZactuatorONOFF=“ONOFF”’
‘-DZactuatorFASTLED=“FASTLED”’
‘-DZsensorINA226=“INA226”’
‘-DZsensorHCSR501=“HCSR501”’
‘-DZsensorADC=“ADC”’
‘-DZsensorBH1750=“BH1750”’
‘-DZsensorBME280=“BME280”’
‘-DZsensorTSL2561=“TSL2561”’
‘-DZsensorDHT=“DHT”’
‘-DZgatewayRFM69=“RFM69”’
‘-DZsensorGPIOInput=“GPIOInput”’
‘-DZsensorGPIOKeyCode=“GPIOKeyCode”’
‘-DGateway_Name=“OpenMQTTGateway_ESP32_ALL”’

[env:esp32dev-rf]
platform = ${com.esp32_platform}
board = esp32dev
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp.lib_deps}
${libraries.rc-switch}
build_flags =
${com-esp.build_flags}
‘-DZgatewayRF=“RF”’
‘-DGateway_Name=“OpenMQTTGateway_ESP32_RF”’

[env:esp32dev-ir]
platform = ${com.esp32_platform}
board = esp32dev
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp.lib_deps}
${libraries.irremoteesp}
build_flags =
${com-esp.build_flags}
‘-DZgatewayIR=“IR”’
‘-DGateway_Name=“OpenMQTTGateway_ESP32_IR”’

[env:esp32dev-ble]
platform = ${com.esp32_platform}
board = esp32dev
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp.lib_deps}
${libraries.ble}
build_flags =
${com-esp.build_flags}
‘-DZgatewayBT=“BT”’
‘-DGateway_Name=“OpenMQTTGateway_ESP32_BLE”’

[env:ttgo-lora32-v1]
platform = ${com.esp32_platform}
board = ttgo-lora32-v1
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp.lib_deps}
${libraries.lora}
build_flags =
${com-esp.build_flags}
‘-DZgatewayLORA=“LORA”’
‘-DGateway_Name=“OpenMQTTGateway_ESP32_LORA”’

[env:nodemcuv2-all]
platform = ${com.esp8266_platform}
board = nodemcuv2
lib_deps =
${com-esp.lib_deps}
${libraries.esppilight}
${libraries.irremoteesp}
${libraries.rfm69}
${libraries.rc-switch}
${libraries.a6lib}
${libraries.newremoteswitch}
${libraries.bme280}
${libraries.bmp180}
${libraries.unifiedsensor}
${libraries.dht}
${libraries.tsl2561}
${libraries.ina226}
${libraries.esp8266_mdns}
${libraries.wire}
${libraries.fastled}
build_flags =
${com-esp.build_flags}
‘-DZgatewayRF=“RF”’
‘-DZgatewayRF2=“RF2”’
‘-DZgatewayIR=“IR”’
‘-DZgatewayBT=“BT”’
‘-DZgateway2G=“2G”’
‘-DZgatewayPilight=“Pilight”’
‘-DZactuatorONOFF=“ONOFF”’
‘-DZactuatorFASTLED=“FASTLED”’
‘-DZsensorINA226=“INA226”’
‘-DZsensorHCSR501=“HCSR501”’
‘-DZsensorADC=“ADC”’
‘-DZsensorBH1750=“BH1750”’
‘-DZsensorBME280=“BME280”’
‘-DZsensorTSL2561=“TSL2561”’
‘-DZsensorDHT=“DHT”’
‘-DZgatewayRFM69=“RFM69”’
‘-DZsensorGPIOInput=“GPIOInput”’
‘-DZsensorGPIOKeyCode=“GPIOKeyCode”’
‘-DGateway_Name=“OpenMQTTGateway_ESP8266_ALL”’
board_build.flash_mode = dout

[env:nodemcuv2-ble]
platform = ${com.esp8266_platform}
board = nodemcuv2
lib_deps =
${com-esp.lib_deps}
${libraries.wire}
${libraries.esp8266_mdns}
build_flags =
${com-esp.build_flags}
‘-DZgatewayBT=“BT”’
‘-DGateway_Name=“OpenMQTTGateway_ESP8266_BLE”’
board_build.flash_mode = dout

[env:nodemcuv2-ir]
platform = ${com.esp8266_platform}
board = nodemcuv2
lib_deps =
${com-esp.lib_deps}
${libraries.irremoteesp}
${libraries.esp8266_mdns}
build_flags =
${com-esp.build_flags}
‘-DZgatewayIR=“IR”’
‘-DGateway_Name=“OpenMQTTGateway_ESP8266_IR”’
board_build.flash_mode = dout

[env:nodemcuv2-rf]
platform = ${com.esp8266_platform}
board = nodemcuv2
lib_deps =
${com-esp.lib_deps}
${libraries.rc-switch}
${libraries.esp8266_mdns}
build_flags =
${com-esp.build_flags}
‘-DZgatewayRF=“RF”’
‘-DGateway_Name=“OpenMQTTGateway_ESP8266_RF”’
board_build.flash_mode = dout

[env:atmega-all]
platform = ${com.atmelavr_platform}
board = megaatmega2560
lib_deps =
${com-arduino.lib_deps}
${libraries.irremote}
${libraries.rfm69}
${libraries.rc-switch}
${libraries.newremoteswitch}
${libraries.bme280}
${libraries.bmp180}
${libraries.unifiedsensor}
${libraries.dht}
${libraries.tsl2561}
${libraries.a6lib}
${libraries.ina226}
${libraries.fastled}
build_flags =
${com-arduino.build_flags}
‘-DZgatewayRF=“RF”’
‘-DZgatewayRF=“RF315”’
‘-DZgatewayRF2=“RF2”’
‘-DZgatewayIR=“IR”’
;’-DZgatewayBT=“BT”’
‘-DZactuatorONOFF=“ONOFF”’
‘-DZactuatorFASTLED=“FASTLED”’
‘-DZsensorINA226=“INA226”’
‘-DZsensorHCSR501=“HCSR501”’
‘-DZsensorADC=“ADC”’
‘-DZsensorBH1750=“BH1750”’
‘-DZsensorBME280=“BME280”’
‘-DZsensorTSL2561=“TSL2561”’
‘-DZsensorDHT=“DHT”’
‘-DZgatewayRFM69=“RFM69”’
‘-DZsensorGPIOInput=“GPIOInput”’
;’-DZsensorGPIOKeyCode=“GPIOKeyCode”’
‘-DZmqttDiscovery=“HADiscovery”’
‘-DGateway_Name=“OpenMQTTGateway_ATMEGA_ALL”’

[env:uno-rf]
platform = ${com.atmelavr_platform}
board = uno
lib_deps =
${com-arduino.lib_deps}
${libraries.rc-switch}
build_flags =
${com-arduino-low-memory.build_flags}
‘-DZgatewayRF=“RF”’
‘-DGateway_Name=“OpenMQTTGateway_UNO_RF”’

[env:uno-fastled]
platform = ${com.atmelavr_platform}
board = uno
lib_deps =
${com-arduino.lib_deps}
${libraries.fastled}
build_flags =
${com-arduino-low-memory.build_flags}
‘-DGateway_Name=“OpenMQTTGateway_UNO_RF”’
‘-DZactuatorFASTLED=“FASTLED”’

;extra_configs =
; tests/*_env.ini

Hello,

Could you check your platformio.ini encoding in VScode, mine is UTF8.
image

I suspect also an issue of environment, do you have the possibility to try a build in another PC?

I’m now having the same issue as you…

Currently investigating

found it,

this is due to special characters in file
ZsensorBH1750.ino

Just remove this file if you don’t need it or remove the lines 85-98 from the file

  /*
  Useful Information ;-)
  lux (lx)                            # 1 lx = 1 lm/m^2 = 1 cd·sr·m⁻^2.
  meter-candle (m-cd)                 # 1 m·cd = 1 lx = 1 lm/m^2 = 1 cd·sr·m⁻^2.
  centimeter-candle (cm-sd)           # 1 m·cd = 1 lx = 1 lm/m^2 = 1 cd·sr·m⁻^2.
  foot-candle (ft-c)                  # 
  phot (ph)                           # 1 ph = 1 lm/cm^2 = 10,000 lm/m^2 - 10,000 lx = 10 klx
  nox (nx)                            # 1 nox = 1 millilux
  candela steradin/meter2(cd·sr·m⁻^2)  # 1 lx = 1 lm/m^2 = 1 cd·sr·m⁻^2
  lumen/meter2 (lm·m⁻^2)               # 1 lx = 1 lm/m^2 = 1 cd·sr·m⁻^2
  lumen/centimeter2 (lm·cm⁻^2)         # 1 lm/cm^2 = 10,000 lx = 10,000 cd·sr·m⁻^2
  lumen/foot2 (lm·ft⁻^2)               # (lm·ft⁻^2)
  watt/centimeter2 at 555nm  (W·cm⁻^2) # 
  */
1 Like

Code modified to avoid this error

Hi.
Just adding a similar error (already solved) to the thread:

WIN 10 EN 64bit
PlatformIO v.2.3.3 Core v.4.0.3 
on Visual Studio CODE v.1.39.1 

Processing nodemcuv2-pilight (platform: espressif8266@1.8.0 ; 2.4.2; board: nodemcuv2; framework: arduino)
PlatformManager: Installing espressif8266 @ 1.8.0 ; 2.4.2
Warning! Package Mirror: Package version 2.2.3 doesn't satisfy requirements 1.8.0 ; 2.4.2
Looking for another mirror...
Warning! Package Mirror: Package version 2.2.3 doesn't satisfy requirements 1.8.0 ; 2.4.2
Looking for another mirror...
Error: Could not install 'espressif8266' with version requirements '1.8.0 ; 2.4.2' for your system 'windows_amd64'.

Please try this solution -> http://bit.ly/faq-package-manager
The terminal process terminated with exit code: 1

In my case, I solved it modifying the platformio.ini line, deleting the version info:

[com]
esp8266_platform =espressif8266
esp32_platform = espressif32@1.9.0
atmelavr_platform = atmelavr@1.13.0

Once modified, the project continued installing stuff, and completed the building process successfully

Thanks for your hard work 1technophile!!

1 Like

Thanks for the info, i will correct it on the dev branch !