-
-
Some tests:
Serial2.setup(9600,{}); ERROR: *** PB *** baudRate = 9600 ERROR: *** PB *** pinRX = 255 ERROR: *** PB *** pinTX = 255 ERROR: *** PB *** pinCK = 255 ERROR: *** PB *** pinCTS = 255 ERROR: *** PB *** bytesize = 8 ERROR: *** PB *** PB0 = 11 ERROR: *** PB *** PB1 = 22 ERROR: *** PB *** PB2 = 33 ERROR: *** PB *** parity = 0 ERROR: *** PB *** stopbits = 1 ERROR: *** PB *** PB3 = 44 ERROR: *** PB *** PB4 = 55 ERROR: *** PB *** PB5 = 66 { }
By default setup, PB0, PB1 and PB2 are not touched.
Serial2.setup(9600,{bytesize:7}); ERROR: *** PB *** baudRate = 9600 ERROR: *** PB *** pinRX = 255 ERROR: *** PB *** pinTX = 255 ERROR: *** PB *** pinCK = 255 ERROR: *** PB *** pinCTS = 255 ERROR: *** PB *** bytesize = 7 ERROR: *** PB *** PB0 = 0 ERROR: *** PB *** PB1 = 0 ERROR: *** PB *** PB2 = 0 ERROR: *** PB *** parity = 0 ERROR: *** PB *** stopbits = 1 ERROR: *** PB *** PB3 = 44 ERROR: *** PB *** PB4 = 55 ERROR: *** PB *** PB5 = 66 { "bytesize": 7 }
With this setup, PB0, PB1 and PB2 are overwritten.
typedef struct { int baudRate; /// FIXME uint32_t ??? Pin pinRX; Pin pinTX; Pin pinCK; ///< Clock, or PIN_UNDEFINED Pin pinCTS; ///< Clear to send, or PIN_UNDEFINED unsigned char bytesize; ///< size of byte, 7 or 8 uint8_t PB0; // insert PB uint8_t PB1; // insert PB uint8_t PB2; // insert PB unsigned char parity; ///< 0=none, 1=odd, 2=even unsigned char stopbits; ///< 1 or 2 uint8_t PB3; // insert PB uint8_t PB4; // insert PB uint8_t PB5; // insert PB bool xOnXOff; ///< XON XOFF flow control? bool errorHandling; ///< Whether to forward parity/framing errors } PACKED_FLAGS JshUSARTInfo;
In the file 'jsserial.c' and in the function 'jsserialPopulateUSARTInfo' there are:
jsvConfigObject configs[] = { {"rx", JSV_PIN, &inf->pinRX}, {"tx", JSV_PIN, &inf->pinTX}, {"ck", JSV_PIN, &inf->pinCK}, {"cts", JSV_PIN, &inf->pinCTS}, {"bytesize", JSV_INTEGER, &inf->bytesize}, {"stopbits", JSV_INTEGER, &inf->stopbits},
I do not know what it's doing, but it returns 4 bytes for 'bytesize' and 'stopbits', like 32 bits, but in 'JshUSARTInfo' they are set up as 'chars'
That is, 'bytesize' overwrites 'parity, stopbits and xOnXOff'.
It's worse with 'stopbits' because it will overwrite 'xOnXOff' and 'errorHandling' as well as write in an illegal address.
Maybe we could get a 'JSV_CHAR' to these two.
If I'm taking a'PICO 'and using:
Serial2.setup(9600,{}); No errors. Minified 2163 bytes to 70 bytes. > ____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v00 (c) 2018 G.Williams >{ }
There's nothing going on.
Serial2.setup(9600,{bytesize:8}); No errors. Minified 2173 bytes to 80 bytes. > ____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v00 (c) 2018 G.Williams >Uncaught InternalError: Unsupported serial stopbits length. at line 1 col 32 ...al2.setup(9600,{bytesize:8}),console.log(Serial2._options),c... ^ >
Which shows that stopbits are overwritten by 0.
Hope it is understandable.
-
Hello @MaBe,
Downloaded last version from 29 / 10-2018.
Tested different things and found that 'ck' is not supported in software serial.
One thing I figured out is that in 'serial2' when I use 'even' and I load the program again, 'esp8266' crashes. However, if I use 'Even', you can reload the program over and over again.
Then try your software serial again without 'ck'.
This time I use an 'uint16_t dummy; // insert PB', instead of 'char 'PS. jeg har kun en ESP8266-01 med 512KB.
-
@MaBe,
Try this, it compiles and loads without errors, but has not tried the communication./// Settings passed to jshUSARTSetup to set it the USART up typedef struct { int baudRate; /// FIXME uint32_t ??? Pin pinRX; Pin pinTX; Pin pinCK; ///< Clock, or PIN_UNDEFINED Pin pinCTS; ///< Clear to send, or PIN_UNDEFINED unsigned char bytesize; ///< size of byte, 7 or 8 unsigned char parity; ///< 0=none, 1=odd, 2=even '#if defined(ESP8266) unsigned char dummy; // insert PB unsigned char dummy1; // insert PB '#endif unsigned char stopbits; ///< 1 or 2 bool xOnXOff; ///< XON XOFF flow control? bool errorHandling; ///< Whether to forward parity/framing errors } PACKED_FLAGS JshUSARTInfo;
Serial2.setup(9600,{rx:D12,tx:D13,ck:D14,cts:D15,bytesize:8,parity:'even',stopbits:1});
1v94.209 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 512KB:256/256, manuf 0xc8 chip 0x4013 > =undefined > =undefined > =undefined >Se Serial3 Serial Serial2 Serial Serial1 Serial2 Server >Seri Serial3 Serial Serial2 Serial Serial1 Serial2 >Serial2._options ={ "rx": D12, "tx": D13, "ck": D14, "cts": D15, "bytesize": 8, "parity": "even", "stopbits": 1 } > =undefined
'#if defined(ESP8266)
'#endif
Remove apostrophe in front of # -
-
Is that something you are looking for?
http://www.espruino.com/InlineC
http://www.espruino.com/Compilation -
I had problems with one of my router so I did this feature:
var boola; function lan() { wlan.connect(logon.ssid, {password: logon.pass}, function (s) { boola = true; if(s==='bad password') { if(debug)console.log('restart lan'); lan(); } }); if(debug)console.log("Frida is my watchdog"); if(debug)console.log(wlan.getIP().ip); } // end lan() setTimeout(lan,400); wlan.on('connected', function(s) { if(debug)console.log('Starter test', wlan.getIP().ip); if(boola) { boola = false; startTimeServer(); if(debug)console.log('tilsluttet lan'); } });
-
-
wifi.on ('connected', function () { console.log ('Connected to Wifi. IP address is:', wifi.getIP () .ip); setTimeout (start server, 400); });
I do not think that 'storage.write ("1.css", ...) is fast enough before the server starts, so I used a delay, maybe it should be different on your system.
I tried with 'setTimeout (StartServer, 400);' and got this picture on screen.
Hope it will take you on. -
Your last line, "onInit ();", do not save to flash.
When you reset, "onInit ();" run automatically.
And I'm waiting to start other features that rely on that
the wifi is connected like this.wifi.connect (ssid, {password: password}, function () { }); wifi.on ('connected', function () { console.log ('Connected to Wifi. IP address is:', wifi.getIP () .ip); server start (); } });
Maybe it can help you further.
-
Sorry, it was my fault, I did not change folders in my batch file, so I flashed an older version, now it's okay.
I did not see that the text was translated into Danish, once more sorry.
Now I'm up to running with the new version.>reset(); =undefined WARNING: --- gap_setScan 0 WARNING: Scan stop failed WARNING: set rssi scan not implemeted yet WARNING: has central connection not implemented yet ____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 1v99.175 (c) 2018 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate >process.env ={ "VERSION": "1v99.175", "GIT_COMMIT": "fe5afe9", "BOARD": "ESP32", "FLASH": 0, "RAM": 524288, "SERIAL": "d8a01d40-9f94", "CONSOLE": "Serial1", "MODULES": "Flash,Storage,fs," ... "r,crypto,neopixel", "EXPTR": 1073485300 } >
-
-
The last downloaded version is espruino_1v99.36_esp32.tgz, but it shows something else when I reset.
____ _ | __ | ___ ___ ___ _ _ | _ | ___ ___ | __ | _ - | . | _ | | | | | . | | ____ | ___ | _ | _ | | ___ | _ | _ | _ | ___ | | _ | espruino.com 1v96.3765 (c) 2018 G.Williams Espruino is open source. Our work is supported Kun ved salg af officielle boards og donationer: http://espruino.com/Donate
-
-
http://forum.espruino.com/conversations/320632/#comment14237159
The version I downloaded runs with approx. 120 gr. C,
taken with E.getTemperature (). -
-
On ver 1v98 I have only a black bar, but on 1v99 I can see the text also.
// Pixl00.js Pixl.menu({'' : {'title' : '--My Menu--'}, 'Backlight on ' : ()=>LED.set(), 'Backlight off' : ()=>LED.reset(), 'Back ' : ()=>Pixl.menu()});
It is the one that is on the backside of the quick reference card.
My old eyes needed a magnifying glass.Now to the question: should 'Back' not restart the menu?
I only get a blank screen.Very nice piece of hardware.
-
I'm back again.
Here is my test code.// esp32test_00 var darray = {}; var count = 0; function getDewpoint(temp, humi) { var C = { a1 : 8.1332, b1 : 1762.39, c1 : 235.66 }; PP = Math.pow(10,C.a1 - C.b1 / (this.temp + C.c1)); this.dewp = -((C.b1 / (Math.log(this.humi * PP / 100) / Math.log(10) - C.a1)) + C.c1); return this.dewp.toFixed(2); } function bprint(dada, navn) { if(dada != 'undefined') { humi = dada.data[8] / 2; temp = dada.data[9] + dada.data[10] / 100; if(temp >128) {temp = 128 - temp;} bati = (dada.data[19] * 256 + dada.data[20]); dewi = getDewpoint(temp, humi); console.log(navn + dada.rssi + ' ' + temp.toFixed(2) + ' ' + humi.toFixed(1) + ' ' + dewi + ' ' + bati); } } function cprint(didi) { console.log('count: ' + count++); console.log(' Sted Rssi Temp Humi Dewi Bati'); bprint(didi[0], ' Ude: '); bprint(didi[1], 'Drivhus: '); bprint(didi[2], ' Bad: '); bprint(didi[3], 'Udestue: '); bprint(didi[4], ' Stue: '); bprint(didi[5], ' test: '); bprint(didi[6], ' test1: '); console.log(' '); } function find() { NRF.findDevices(function(devices) { console.log('found devices: ', devices.length); for(i=0;i<devices.length;i++) { if(devices[i].id == 'ce:5c:55:08:22:5a') { darray[0] = devices[i]; } if(devices[i].id == 'da:dc:f2:19:d4:e3') { darray[1] = devices[i]; } if(devices[i].id == 'fa:2e:7b:6d:97:e0') { darray[2] = devices[i]; } if(devices[i].id == 'fc:62:2d:b7:96:30') { darray[3] = devices[i]; } if(devices[i].id == 'f9:1c:5f:be:b1:ec') { darray[4] = devices[i]; } if(devices[i].id == 'c7:cf:a0:a7:86:d0') { darray[5] = devices[i]; } if(devices[i].id == 'de:b4:9d:e1:39:08') { darray[6] = devices[i]; } } cprint(darray); }, 5000); } find(); setInterval(function () { find(); }, 30000);
-
-
My first test.
Download the files from here: http://microcosm.app/out/DsGCh
I threw the files on esp32 and started collecting my ruuvi tags.
My ruuvi tags emit raw sensor data, so no connection is required.
It all runs stable.
Good work.WARNING: check error not implemented yet:0 WARNING: Stop scan successfully WARNING: check error not implemented yet:0 found devices: 7 count: 14 Sted Rssi Temp Humi Dewi Bati Ude: -90 13.35 87.5 11.33 2971 Drivhus: -77 16.98 73.5 12.23 2977 Bad: -78 23.05 45.0 10.52 2977 Stue: -85 23.15 47.5 11.42 2959 test: -95 22.20 47.5 10.55 2947 test1: -75 23.04 46.5 10.99 3181 WARNING: check error not implemented yet:0 WARNING: Stop scan successfully WARNING: check error not implemented yet:0 found devices: 8 count: 15 Sted Rssi Temp Humi Dewi Bati Ude: -86 13.33 87.0 11.22 2989 Drivhus: -78 16.97 74.0 12.32 2983 Bad: -79 23.05 45.0 10.52 2983 Stue: -82 23.15 47.5 11.42 2947 test: -89 22.20 47.5 10.55 2947 test1: -72 23.03 46.5 10.99 3187 WARNING: check error not implemented yet:0 WARNING: Stop scan successfully WARNING: check error not implemented yet:0 found devices: 7 count: 16 Sted Rssi Temp Humi Dewi Bati Ude: -86 13.33 87.0 11.22 2989 Drivhus: -74 16.96 74.0 12.31 2977 Bad: -81 23.05 45.0 10.52 2983 Stue: -83 23.15 47.5 11.42 2953 test: -89 22.20 47.5 10.55 2947 test1: -74 23.03 46.5 10.99 3181
-
-
It seems to work on esp32
On esp32 I get a catch, but on esp8266 nothing happens// mqtt_simple_V0.6_test01.js var ver = 'V0.6'; var client; function onConnect() { console.log('her er der noget'); } function onInit(){ var logon = require('LOGON'); console.log("Connecting to WiFi"); wifi = require("Wifi"); wifi.connect(logon.ssid, {password:logon.pass}, function(err){ console.log("connected? err=", err, "info=", wifi.getIP()); console.log('creating client'); try { client = require("net").connect({host: "192.168.20.21", port: 1883}, onConnect); } // end try catch(e) { console.log('err ' + e); } // end catch }); } onInit(); // remove before save()
/* on esp8266 No error. Minified 58 bytes to 49 bytes. > ____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 1v96.51 (c) 2018 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 512KB:256/256, manuf 0xe0 chip 0x4014 >Connecting to WiFi =undefined connected? err= null info= { "ip": "192.168.20.30", "netmask": "255.255.255.0", "gw": "192.168.20.1", "mac": "5c:cf:7f:e7:d2:7b" } creating client > */
/* on esp32 No error. Minified 58 bytes to 49 bytes. > ____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 1v96.35 (c) 2018 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate >Connecting to WiFi =undefined connected? err= null info= { "ip": "192.168.20.50", "netmask": "255.255.255.0", "gw": "192.168.20.1", "mac": "d8:a0:1d:40:6e:40" } creating client ERROR: Connect failed (err 113) err InternalError: Unable to create socket > */
Yes, on esp32, I get the error because I have not started the client, but nothing on esp8266
Donated 100,00 USD to
Pur3 Ltd