Most recent activity
-
-
-
-
-
You need to compile the espruino firmware locally on your own PC. I did my compilation on:
$ uname -a
Linux kaki5 5.13.0-30-generic #33~20.04.1-Ubuntu SMP Mon Feb 7 14:25:10 UTC 2022 x86_64 x86_64 x86_64 GNU/LinuxOne this we need to change in user_main.c under Espruino/targets/esp8266
$ diff user_main.c user_main.c-ORIG
353,382d352
< void ICACHE_FLASH_ATTR user_pre_init(void)
< {
< bool rc = false;
< static const partition_item_t part_table[] =
< {
< {SYSTEM_PARTITION_RF_CAL,
< 0x3fb000,
< 0x1000},
< {SYSTEM_PARTITION_PHY_DATA,
< 0x3fc000,
< 0x1000},
< {SYSTEM_PARTITION_SYSTEM_PARAMETER,
< 0x3fd000,
< 0x3000},
< };
<
< // This isn't an ideal approach but there's not much point moving on unless
< // or until this has succeeded cos otherwise the SDK will just barf and
< // refuse to call user_init()
< while (!rc)
< {
< rc = system_partition_table_regist(part_table,
< sizeof(part_table)/sizeof(part_table[0]),
< 4);
< }
<
< return;
< }
<
<
388d357
< user_pre_init();The firmware would not compile without the user_pre_init(). Insert this block of code
void ICACHE_FLASH_ATTR user_pre_init(void)
{
bool rc = false;
static const partition_item_t part_table[] =
{{SYSTEM_PARTITION_RF_CAL, 0x3fb000, 0x1000}, {SYSTEM_PARTITION_PHY_DATA, 0x3fc000, 0x1000}, {SYSTEM_PARTITION_SYSTEM_PARAMETER, 0x3fd000, 0x3000},
};
// This isn't an ideal approach but there's not much point moving on unless
// or until this has succeeded cos otherwise the SDK will just barf and
// refuse to call user_init()
while (!rc)
{rc = system_partition_table_regist(part_table, sizeof(part_table)/sizeof(part_table[0]), 4);
}
return;
}Above the void user_init() function. Insert user_pre_init() as the first statement in the user_init() function
void user_init() {
user_pre_init(); system_timer_reinit(); // use microsecond os_timer_* ....
I do not use the Espruino/scripts/provision.sh to build, but my own simple script:
#!/usr/bin/sh
echo "----------------------------------------------------------"
echo "Building Espruino for ESP8266 4MB Flash"
export ESP8266_SDK_ROOT=/home/sharil/MJ/ESP8266_NONOS_SDK
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:pwd
/xtensa-lx106-elf/bin/
echo GCC is $(which xtensa-lx106-elf-gcc)
rm espruinoesp8266
make cleanmake V=1 RELEASE=1 BOARD=ESP8266_4MB
make V=1 RELEASE=1 BOARD=ESP8266_ME
echo "ESP8266 (4MB Flash) build done"
echo "----------------------------------------------------------"Note that used ESP8266_ME board which is a copy of ESP8266_4MB.py with 'FILESYSTEM', 'FLASHFS' included in the libraries.
Please give it a try.
-
Wemos NodeMCU V3 is a nice dev board. It is ashamed that Espruino WiFi is not
working on it. I've managed to compile Espruino with SDK 3.0.6-dev(865fa65). The
SDK used with Arduino. But sadly, still problem with Espruino WiFi.
Wemos NodeMCU V3 ESP8266
process.env
={
VERSION: "2v12.58",
GIT_COMMIT: "f148c737",
BOARD: "ESP8266_ME",
FLASH: 0, STORAGE: 196608, RAM: 81920,
SERIAL: "d8f15b07-1f41",
CONSOLE: "Serial1",
MODULES: "Flash,Storage,hea" ... "r,crypto,neopixel",
EXPTR: 1073648148 }var esp=require("ESP8266")
esp.getState()
={
sdkVersion: "3.0.6-dev(865fa65)",
cpuFrequency: 80, freeHeap: 12752, maxCon: 10,
flashMap: "4MB:512/512",
flashKB: 4096,
flashChip: "0x20 0x4016"
}var wifi=require('Wifi')
wifi.stopAP()
wifi.getStatus()
={
mode: "off",
station: "off",
ap: "disabled",
phy: "11n",
powersave: "ps-poll",
savedMode: "off"
}wifi.scan((w)=>print(w))
[ ]wifi.getStatus()
={
mode: "sta",
station: "off",
ap: "disabled",
phy: "11n",
powersave: "ps-poll",
savedMode: "off"
}wifi.scan((w)=>print(w))
[ ]
now on another board. AI ESP-12S ESP8266
process.env
={
VERSION: "2v12.58",
GIT_COMMIT: "f148c737",
BOARD: "ESP8266_ME",
FLASH: 0, STORAGE: 196608, RAM: 81920,
SERIAL: "e8db849c-4951",
CONSOLE: "Serial1",
MODULES: "Flash,Storage,hea" ... "r,crypto,neopixel",
EXPTR: 1073648148 }
var esp=require("ESP8266")esp.getState()
={
sdkVersion: "3.0.6-dev(865fa65)",
cpuFrequency: 80, freeHeap: 12752, maxCon: 10,
flashMap: "4MB:512/512",
flashKB: 4096,
flashChip: "0xd8 0x4016"
}
var wifi=require('Wifi')wifi.scan((w)=>print(w))
[
{ "rssi": -84, "channel": 1,"authMode": "wpa2", "isHidden": false, "ssid": "NextGenTel_6332", "mac": "60:03:a6:2e:63:32"
},
...
...
{ "rssi": -81, "channel": 11,"authMode": "wpa2", "isHidden": false, "ssid": "Telenor7783gre", "mac": "b8:ec:a3:53:24:83"
}
]So newer SDK does not solve the problem. I think it is a hardware problem. Can the chip did not get enough power during WiFi operation. I say this because I got brown out when using Espruino on ESP32 hub without external power.
-
I have the same problem with the same board shown above. It seem that the WiFi is not working properly on WeMos Dev board (weak WiFI, maybe?) with Espruino. Please try with other board. I try on an old NodeMcu board and it went ok. I said, 'weak WiFi' because running scan with MicroPython on the WeMos board returned only a few AP where there should be plenty. Give it a try on another dev board other then WeMos.
You can not easily access the UART/SPI pins without opening the watch from its casing. This means practically destroying your Bangle.js 2.