-
Hi,
I'm trying to make work 2 esp32 modules with lora. But I did not succed.
espruino version: 1v99.4103
pinout (i hope it is good): https://cdn.hackaday.io/files/269911154782944/Heltec_WIFI-LoRa-32_DiagramPinout.jpgFor tx code i use:
SPI1.setup({ sck:D5, mosi:D27, miso: D19 }); var sx = require("SX127x").connect({spi: SPI1, cs: D18, rst : D14 }); setInterval(function() { sx.onIRQ(); }, 100); var config = { freq: 868E6 }; sx.setTxConfig(config); sx.send("Hello", function() { console.log("TX done"); });
for the rx config i use:
SPI1.setup({ sck:D5, mosi:D27, miso: D19 }); var sx = require("SX127x").connect({spi: SPI1, cs: D18, rst : D14 }); setInterval(function() { sx.onIRQ(); }, 100); var config = { rxContinuous : true, freq: 868E6 }; console.log('starting receiver'); sx.setRxConfig(config); // enter receive mode sx.rx(function(err, inf) { // Error, or you get signal strength and data returned in an object if (err) console.log("RX ERROR"); else console.log("RX>",inf); });
I got no erros. On tx I got nothing. On rx I got this after upload:
>starting receiver RX> { "snr": 82, "rssi": 82, "data": new Uint8Array([82, 82, 106, 57, 74, 161, 198, 62, 219, 7, 163, 65, 161, 130, 133, 51, 199, 36, 195, 5, 38, 5, 180, 150, 128, 35, 21, 91, 209, 28, 236, 12, 240, 80, 184, 230, 197, 134, 10, 22, 185, 154, 4, 0, 65, 225, 192, 10, 25, 14, 79, 117, 132, 194, 240, 160, 192, 83, 163, 48, 201, 0, 242, 12, 28, 228, 98, 16, 132, 5, 180, 231, 64, 201, 65, 82, 108, 14, 10, 232, 244, 114]) }
What I'm doing wrong?
thanks
-
-
-
-
-
Thanks! I downloaded your binaries.
Do you have example code for?
- rx and tx with lora module
- bluetooth
Yesterday I successfully created a code to drive the oled, but with this espruino version I got this:
>WARNING: jshI2CSetup: driver installed, sda: 4 sdl: 15 freq: 100000, ERROR: jshI2CWrite:, slave doesn't ACK the transfer.
And the the code worked yesterday does not drive with this espruino version.
- rx and tx with lora module
-
-
I downloaded the latest binary from travis, but it does not help for me.
How can I make this work? (I got this board just today.)
So answering for myself:
flash complett 1v95 version,
then just flash the espruino_esp32.binAnd now I can use espruino ide, but the ide is slow. (the same speed trough wifi connection)
-
Can U paste here, the lora connection code too? The oled is working for me. (but wifi connection is not with espruino version espruino 1v95)
this is what is not working for me:
SPI1.setup({ sck:D5, mosi:D27, miso: D19 }); var sx = require("SX127x").connect({spi: SPI1, cs: D18, rst : D14 }); setInterval(function() { sx.onIRQ(); }, 100); var config = { rxContinuous : true, bandwidth: 2 }; /* sx.setRxConfig(config); // enter receive mode sx.rx(function(err, inf) { // Error, or you get signal strength and data returned in an object if (err) console.log("RX ERROR"); else console.log("RX>",inf); }); // after a while, stop receiving setTimeout(function() { sx.standby(); }, 10000); */ sx.setTxConfig(config); sx.send("Hello", function() { console.log("TX done"); });
-
-
@Gordon Uh this is really cool! Thanks for it!!!
-
-
I just recieved my esp32 supporting board, soldered ESP-32S (blue one).
when powering up i got this in a serial terminal:
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0x00 clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3ffc0000,len:0 load:0x3ffc0000,len:2568 load:0x40078000,len:4092 load:0x40098000,len:704 entry 0x400981dc I (26) boot: Espressif ESP32 2nd stage bootloader v. V0.1 I (33) boot: compile time 09:30:50 D (54) boot: mmu set paddr=00000000 count=1 D (54) boot: magic e9 D (54) boot: blocks 04 D (54) boot: spi_mode 02 D (54) boot: spi_speed 00 D (56) boot: spi_size 02 I (60) boot: SPI Speed : 40MHz I (65) boot: SPI Mode : DIO I (69) boot: SPI Flash Size : 4MB I (74) boot: Partition Table: I (78) boot: ## Label Usage Type ST Offset Length D (87) boot: load partition table entry from 4000(3f404000) D (95) boot: type=0 subtype=0 I (99) boot: 0 factory factory app 00 00 00010000 00100000 D (109) boot: load partition table entry from 4020(3f404020) D (117) boot: type=1 subtype=1 I (121) boot: 1 rfdata RF data 01 01 00110000 00040000 D (131) boot: load partition table entry from 4040(3f404040) D (139) boot: type=1 subtype=2 I (143) boot: 2 wifidata WiFi data 01 02 00150000 00040000 D (153) boot: load partition table entry from 4060(3f404060) D (161) boot: type=ff subtype=ff I (165) boot: End of partition table I (170) boot: Loading app partition at offset 00010000 D (177) boot: mmu set paddr=00010000 count=16 D (183) boot: bin_header: 233 8 2 2 40080780 I (189) boot: section 0: paddr=0x00000020 vaddr=0x00000000 size=0x0ffe8 ( 65512) D (200) boot: found drom section, map from 00010010 to 3f400010 I (208) boot: section 1: paddr=0x00010010 vaddr=0x3f400010 size=0x05b84 ( 23428) map I (220) boot: section 2: paddr=0x00015b9c vaddr=0x3ffbf100 size=0x0130c ( 4876) load T�@�N@?��@T�@�N@?��@T�@�N@?��@T�@�N@?��@T�@�N@?��@ e K r @I (280) heap_alloc_caps: Initializing heap allocator: I (280) heap_alloc_caps: Region 19: 3FFC040C len 0001FBF4 tag 0 I (284) heap_alloc_caps: Region 23: 3FFE8000 len 00010000 tag 1 check b=0x3ffc0418 size=130008 ok check b=0x3ffdfff0 size=0 ok check b=0x3ffe800c size=65508 ok I (306) cpu_start: Pro cpu up. I (310) cpu_start: Single core mode I (315) cpu_start: Pro cpu start user code rtc v112 Sep 26 2016 22:32:10 XTAL 40M I (348) cpu_start: Starting scheduler on PRO CPU. D (350) nvs: init start=6 count=3 D (353) nvs: nvs_open misc 1 D (354) nvs: nvs_get_str_or_blob log frc2_timer_task_hdl:3ffc4290, prio:22, stack:2048 tcpip_task_hdlxxx : 3ffc4ec4, prio:18,stack:2048 phy_version: 123, Sep 13 2016, 20:01:58, 0 D (486) nvs: nvs_open nvs.net80211 1 D (486) nvs: nvs_get opmode 1 D (486) nvs: nvs_get country 1 D (487) nvs: nvs_get_str_or_blob sta.ssid D (491) nvs: nvs_get_str_or_blob sta.mac D (494) nvs: nvs_get sta.authmode 1 D (497) nvs: nvs_get_str_or_blob sta.pswd D (501) nvs: nvs_get_str_or_blob sta.pmk D (505) nvs: nvs_get sta.chan 1 D (508) nvs: nvs_get auto.conn 1 D (511) nvs: nvs_get bssid.set 1 D (514) nvs: nvs_get_str_or_blob sta.bssid D (517) nvs: nvs_get sta.phym 1 D (520) nvs: nvs_get sta.phybw 1 D (523) nvs: nvs_get_str_or_blob sta.apsw D (527) nvs: nvs_get_str_or_blob sta.apinfo D (531) nvs: nvs_get_str_or_blob ap.ssid D (535) nvs: nvs_get_str_or_blob ap.mac D (538) nvs: nvs_get_str_or_blob ap.passwd D (542) nvs: nvs_get_str_or_blob ap.pmk D (546) nvs: nvs_get ap.chan 1 D (548) nvs: nvs_get ap.authmode 1 D (551) nvs: nvs_get ap.hidden 1 D (554) nvs: nvs_get ap.max.conn 1 D (557) nvs: nvs_get bcn.interval 2 D (561) nvs: nvs_get ap.phym 1 D (563) nvs: nvs_get ap.phybw 1 D (566) nvs: nvs_get ap.sndchan 1 D (569) nvs: nvs_set_blob sta.mac 6 D (583) nvs: nvs_set_blob ap.mac 6 pp_task_hdl : 3ffc877c, prio:23, stack:8192 get wifi mode: 2 set wifi mode get wifi ap mac: 0A:C4:03:03:FB:68 get wifi ap ssid: Ai-Thinker_ESP32_03FB68 get wifi ap password: 12345678 set wifi ap ... get wifi sta ssid: get wifi sta password: set wifi sta ... wifi start mode : softAP(24:0a:c4:03:fb:69) D (605) event: SYSTEM_EVENT_AP_START V (607) event: enter default callback dhcp server start:(ip: 192.168.4.1, mask: 255.255.255.0, gw: 192.168.4.1) V (617) event: exit default callback Ai-Thinker Technology Co. Ltd. Oct 13 2016 09:39:50 start led blink task. start http server task. Welcome to use ESP-32S Module ! Welcome to use ESP-32S Module !
The last line is repeating...
I press the reset and io0 and then release the reset, then io0, in serial terminal i got this:
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2)) waiting for download
Then I try to flash it:
hygy@hygy-ThinkPad-E450:~/work/espruino/esp32/esptool(master % u=)$ ./esptool.py --port /dev/ttyUSB1 --baud 230400 write_flash -z --flash_mode dio --flash_freq 40m --flash_size 16MB 0x1000 ../bootloader.bin 0x10000 ../espruino_esp32.bin 0x8000 ../partitions_singleapp.bin esptool.py v2.0-beta1 Connecting.... Detecting chip type... ESP32 Uploading stub... A fatal error occurred: Invalid head of packet ('\x00')
What I'm doing wrong?
-
So I have an orange pi zero, cloned the espruino repo, successfully compilled it and it is runing:
root@orangepizero:/home/hygy/Espruino# ./espruino Interactive mode. Size of JsVar is now 28 bytes Size of JsVarRef is now 4 bytes Added SIGINT hook Added SIGHUP hook Added SIGTERM hook Decompressing to 114688 bytes... >1+1 =2
I cloned and compiled wiringOP:
root@orangepizero:/home/hygy/WiringOP/gpio# ./gpio readall +-----+-----+----------+------+---+-Orange Pi+---+---+------+---------+-----+--+ | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM | +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+ | | | 3.3v | | | 1 || 2 | | | 5v | | | | 12 | 8 | SDA.0 | ALT5 | 0 | 3 || 4 | | | 5V | | | | 11 | 9 | SCL.0 | ALT5 | 0 | 5 || 6 | | | 0v | | | | 6 | 7 | GPIO.7 | ALT3 | 0 | 7 || 8 | 0 | ALT3 | TxD3 | 15 | 13 | | | | 0v | | | 9 || 10 | 0 | ALT3 | RxD3 | 16 | 14 | | 1 | 0 | RxD2 | ALT5 | 0 | 11 || 12 | 0 | ALT3 | GPIO.1 | 1 | 110 | | 0 | 2 | TxD2 | ALT5 | 0 | 13 || 14 | | | 0v | | | | 3 | 3 | CTS2 | ALT3 | 0 | 15 || 16 | 0 | ALT3 | GPIO.4 | 4 | 68 | | | | 3.3v | | | 17 || 18 | 0 | ALT3 | GPIO.5 | 5 | 71 | | 64 | 12 | MOSI | ALT4 | 0 | 19 || 20 | | | 0v | | | | 65 | 13 | MISO | ALT4 | 0 | 21 || 22 | 0 | ALT3 | RTS2 | 6 | 2 | | 66 | 14 | SCLK | ALT4 | 0 | 23 || 24 | 0 | ALT4 | CE0 | 10 | 67 | | | | 0v | | | 25 || 26 | 0 | ALT3 | GPIO.11 | 11 | 21 | | 19 | 30 | SDA.1 | ALT4 | 0 | 27 || 28 | 0 | ALT4 | SCL.1 | 31 | 18 | | 7 | 21 | GPIO.21 | ALT3 | 0 | 29 || 30 | | | 0v | | | | 8 | 22 | GPIO.22 | ALT3 | 0 | 31 || 32 | 0 | ALT3 | RTS1 | 26 | 200 | | 9 | 23 | GPIO.23 | ALT3 | 0 | 33 || 34 | | | 0v | | | | 10 | 24 | GPIO.24 | OUT | 1 | 35 || 36 | 0 | ALT3 | CTS1 | 27 | 201 | | 20 | 25 | GPIO.25 | OUT | 1 | 37 || 38 | 0 | ALT5 | TxD1 | 28 | 198 | | | | 0v | | | 39 || 40 | 0 | ALT5 | RxD1 | 29 | 199 | +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+ | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM | +-----+-----+----------+------+---+-Orange Pi+---+------+----------+-----+-----+
Now how can I access orange pi zero gpio from espruino?
-
Hi,
I'm using a few esp8266 with latest stable espruino build. After a while I cannot access anymore trough mqtt, and nor with espruino ide.
Here is what I can see from the console:
$ ping 192.168.1.5 PING 192.168.1.5 (192.168.1.5) 56(84) bytes of data. 64 bytes from 192.168.1.5: icmp_seq=1 ttl=128 time=6.14 ms 64 bytes from 192.168.1.5: icmp_seq=2 ttl=128 time=10.9 ms ^C --- 192.168.1.5 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 6.140/8.551/10.963/2.413 ms $ nc 192.168.1.5 23 $ telnet 192.168.1.5 88 Trying 192.168.1.5... Connected to 192.168.1.5. Escape character is '^]'. get HTTP/1.1 400 ERROR Content-Type: text/plain Content-Length: 20 Connection: close Cache-Control: no-store, no-cache, must-revalidate Invalid HTTP request^] telnet> quit Connection closed. hygy@hygy-Lenovo-G505:~$
So the esp is up, and running, the code inside is running (couse I can use the connected switch, what change the light state). I can ping, access it trough port 88, but not the espruino ide port, and the running mqtt code is not accessible.
What can be wrong?
HyGy
ps. I'm using a few nodemcu, witty, etc... All the same.
-
My (2) sonoff is worked good without any problem.
But now I try to flash a simple esp8266. The flasing is success. And I think I got the same:
>>> Connecting... Set Slow Write = true [object Object] Connected [object Object] Found a prompt... great! >>> Sending... ---> "echo(0);\nconsole.log(\"<\",\"<<\",JSON.stringify(process.env),\">>\",\">\");echo(1);\n" Sending block "echo(0);\nconsol", wait 50ms Sent Sending block "e.log(\"<\",\"<<\",", wait 50ms Sent Sending block "JSON.stringify(", wait 50ms Sent Sending block "process.env),\">", wait 50ms Sent Sending block ">\",\">\");echo(1)", wait 50ms Sent Sending block ";\n", wait 50ms Sent >>> Sent WARNING: No result found - just got "" Device found (connectionId=20) >>> Connected to port /dev/ttyUSB0 Sending block "1", wait 50ms Sent Sending block "1", wait 50ms Sent Sending block "\r", wait 50ms Sent Sending block "1", wait 50ms Sending block "2", wait 50ms
-
-
-
I'ts not good for me:
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v85 Copyright 2016 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xe0 chip 0x4016 >echo(0); { "sdkVersion": "1.5.0", "cpuFrequency": 160, "freeHeap": 8768, "maxCon": 10, "flashMap": "4MB:512/512", "flashKB": 4096, "flashChip": "0xe0 0x4016" } =undefined { "err": true, "checksumError": true, "raw": "0100000001101000110000000011110001100", "temp": -1, "rh": -1, "n": 1 } { "err": true, "checksumError": true, "raw": "0100000001101001000000000011110001", "temp": -1, "rh": -1, "n": 1 } { "err": true, "checksumError": true, "raw": "0100000001101000110000000011110001100", "temp": -1, "rh": -1, "n": 1 } { "err": true, "checksumError": true, "raw": "010000000110100011000000001111000110", "temp": -1, "rh": -1, "n": 1 } { "err": true, "checksumError": true, "raw": "010000000110100011000000001111000110", "temp": -1, "rh": -1, "n": 1 } { "err": true, "checksumError": true, "raw": "010000000110100011000000001111000110", "temp": -1, "rh": -1, "n": 1 } { "err": true, "checksumError": true, "raw": "0100000001101000110000000011110001", "temp": -1, "rh": -1, "n": 1 } { "err": true, "checksumError": true, "raw": "0100000001101001000000000011110001100", "temp": -1, "rh": -1, "n": 1 } { "err": true, "checksumError": true, "raw": "010000000110100011000000001111000110", "temp": -1, "rh": -1, "n": 1 }
and some times this (but 95% is the above):
{ "o": { "raw": "010000000110100011000000001111000110010101", "rh": 41.9, "t": 24.1 }, "n": 1 }
-
Some times I have checksum errors on ESP.
getting DHT sensor values { "err": true, "checksumError": true, "raw": "010000000110111110000000001101", "temp": -1, "rh": -1 } Temp is -1 and RH is -1 E-Flags: [] { "free": 967, "usage": 633, "total": 1600, "history": 398 } { "sdkVersion": "1.5.0", "cpuFrequency": 160, "freeHeap": 9816, "maxCon": 10, "flashMap": "4MB:512/512", "flashKB": 4096, "flashChip": "0xe0 0x4016" } 183> < jshCanWatch = true 190708> > jshCanWatch: pin=0 190709> < jshCanWatch = true 191235> > jshCanWatch: pin=0 191236> < jshCanWatch = true 191761> > jshCanWatch: pin=0 191762> < jshCanWatch = true 192287> > jshCanWatch: pin=0 192287> < jshCanWatch = true getting DHT sensor values { "raw": "010000000110111110000000001101001010010001", "rh": 44.6, "temp": 21 } Temp is 21 and RH is 44.6
Added the debug things what @MaBe said:
setTimeout(function(){ console.log("E-Flags: ["+E.getErrorFlags()+"]\n\n"); console.log(process.memory()); console.log(ESP8266.getState()); }, 1000);
-
-
@Gordon it is much better. It is sometimes reads -1 -1 but mostly it is good. (I'm running the tests on an ESP8266 with the new tve build.)
getting DHT sensor values { "raw": "010000000110000110000000001100101101010010", "rh": 39, "temp": 20.3 } Temp is 20.3 and RH is 39 getting DHT sensor values { "err": true, "checksumError": true, "raw": "01000000011000100000000000110010", "temp": -1, "rh": -1 } Temp is -1 and RH is -1 getting DHT sensor values { "err": true, "checksumError": true, "raw": "0100000001100001110000000011001", "temp": -1, "rh": -1 } Temp is -1 and RH is -1 getting DHT sensor values { "raw": "010000000110000111000000001100101101010011", "rh": 39.1, "temp": 20.3 } Temp is 20.3 and RH is 39.1
Here is the build version:
>reset() =undefined _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v85.tve_master_cee7141 Copyright 2016 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xe0 chip 0x4016
-
Yeah, but theese are not complett devices with integrated ethernet port. So need to buy more things and solder and fail etc....