by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 05 22:08
    CrispinP commented #2264
  • Jun 05 20:08
    mcspr commented #2269
  • Jun 05 20:08
    mcspr commented #2269
  • Jun 05 19:39
    mcspr commented #2269
  • Jun 05 19:39
    mcspr commented #2269
  • Jun 05 19:27
    dpeddi commented #2269
  • Jun 05 19:24
    mcspr commented #2271
  • Jun 05 19:22
    mcspr commented #2264
  • Jun 05 19:00
    mcspr commented #2269
  • Jun 05 18:42
    mcspr commented #2272
  • Jun 05 12:26
    dpeddi commented #2269
  • Jun 05 11:34
    mindtripper commented #2272
  • Jun 05 11:34
    mindtripper commented #2272
  • Jun 05 09:44
    mcspr commented #2272
  • Jun 05 09:41
    mcspr commented #2269
  • Jun 05 08:00
    mindtripper labeled #2272
  • Jun 05 08:00
    mindtripper opened #2272
  • Jun 05 07:55
    mindtripper closed #2260
  • Jun 05 07:55
    mindtripper commented #2260
  • Jun 05 07:27
    mcspr labeled #2270
Marco Martins
@mamartins
#if SONAR_SUPPORT
{
    SonarSensor * sensor = new SonarSensor();
    sensor->setEcho(SONAR_ECHO);
    sensor->setIterations(SONAR_ITERATIONS);
    sensor->setMaxDistance(SONAR_MAX_DISTANCE);
    sensor->setTrigger(SONAR_TRIGGER);
    _sensors.push_back(sensor);  
  SonarSensor * sensor2 = new SonarSensor();
    sensor2->setEcho(SONAR_ECHO_2);
    sensor2->setIterations(SONAR_ITERATIONS);
    sensor2->setMaxDistance(SONAR_MAX_DISTANCE);
    sensor2->setTrigger(SONAR_TRIGGER_2);
    _sensors.push_back(sensor2);    }
#endif
Marco Martins
@mamartins
And crates new Constants for the sensor nr 2 trigger and echo
Marco Martins
@mamartins
*created
Max Prokhorov
@mcspr
@mamartins that should work. my main question is how it does "stop responding"; does it not show sensor readings, web alert shows connection lost or readings are 0 both web and telnet?
julianwb
@julianwb
Is there somewhere I can add information about devices not mentioned in https://github.com/xoseperez/espurna/wiki/Hardware? Have a UK (Amazon) device Maxcio W-UK007S working, (also the older Teckin SP23 .. the one with power monitoring).
Max Prokhorov
@mcspr
@julianwb feel free to update the page with the name+flag entry, thanks for checking those devices out. we also do have some duplicates mentioned in the code/espurna/config/hardware.h comments when it's appropriate
julianwb
@julianwb
@mcspr I have overriden some of the hardware.h in my custom.h in order to configure these. Should I make a PR with updated hardware.h, or just describe the changes on the Wiki?
Max Prokhorov
@mcspr
hardware.h would be preferable
(however that depends on the extent of changes, can't really tell from device names)
julianwb
@julianwb
@mcspr OK, will do over the next day or two. Changes consist of redefining LED, SW and Relay pins only at present, I will check and fix HLW8012 ratios before submitting.
julianwb
@julianwb
@mcspr PR created, hopefully it'll be OK, happy to fix as required.
I have a change I have made for my personal use that could be of interest.
julianwb
@julianwb
And another thing: locally I have added the ability to switch on relay, and for it to remain on until the current consumption is less than a supplied value. This is of use to me when I trigger say a washing machine, I want the cycle to finish but different cycles take different times, so "pulse" as it is is no help. Would this be of interest to others? Currently the work is not suitable for merge, I would need to "do it properly"! E.g. I am using the "pulse" parameter as an indicator - if < 0 then the value is interpreted as a current threshold. This may or may not be deemed acceptable. Definitely bad: I have exposed getCurrent from sensor.ino .. pretty sure I should be using "broker" but I haven't found an example .. any pointers would be helpful.
Max Prokhorov
@mcspr
@julianwb thanks! will check it out later
btw broker already sends data to rpn rules module, which may be used as-is or extended with some kind of timer
i.e. don't turn off relay instantly, but set up a timer when the value matches the condition. see https://github.com/xoseperez/espurna/wiki/RPN-Rules
julianwb
@julianwb
@mcspr Thanks - I found some broker stuff, and have fixed that bit. I have modified only relay.ino and I am using relayStatus, so it is using a timer. Same functionality could almost certainly be implemented in RPN rules - but I find the "pulse" extension really easy to use. If no one else wants it that's fine - I'll keep it for me, but if it is of potential use then maybe it could be merged. If OK with you I will put up a PR (feel free to reject it as and when) .. as that is an easy way to present what I have done, comment would be welcome.
Max Prokhorov
@mcspr
@julianwb please do
julianwb
@julianwb
@mcspr I have create a "speculative" PR .. would welcome your comments. It does what I want, but that doesn't mean it is acceptbale in the code base I know :)
karmacoma92
@karmacoma92

hi again, I'm still going in circles with TZ.h, I have added "#include </home/oscar/.platformio/packages/framework-arduinoespressif8266/cores/esp8266/TZ.h>" but with no luck, now I get the following:

/home/oscar/PlatformIO/Projects/espurna-1.14.2.PA5/espurna/code/espurna/ntp.ino: In function 'String _ntpGetServer()':
/home/oscar/PlatformIO/Projects/espurna-1.14.2.PA5/espurna/code/espurna/ntp.ino:174:44: error: invalid conversion from 'const ip_addr_t {aka const ip4_addr}' to 'uint32_t {aka unsigned int}' [-fpermissive]
server = IPAddress(sntp_getserver(0)).toString();
^
In file included from /home/oscar/.platformio/packages/framework-arduinoespressif8266@2.20402.4/libraries/ESP8266WiFi/src/ESP8266WiFi.h:31:0,
from espurna/wifi.h:12,
from /home/oscar/PlatformIO/Projects/espurna-1.14.2.PA5/espurna/code/espurna/espurna.ino:38:
/home/oscar/.platformio/packages/framework-arduinoespressif8266@2.20402.4/cores/esp8266/IPAddress.h:48:9: error: initializing argument 1 of 'IPAddress::IPAddress(uint32_t)' [-fpermissive]
IPAddress(uint32_t address);
^
/home/oscar/PlatformIO/Projects/espurna-1.14.2.PA5/espurna/code/espurna/ntp.ino: In function 'void _ntpConfigure()':
/home/oscar/PlatformIO/Projects/espurna-1.14.2.PA5/espurna/code/espurna/ntp.ino:220:33: error: invalid conversion from 'const char' to 'long int' [-fpermissive]
configTime(cfg_tz.c_str(), _ntp_server.c_str());
^
/home/oscar/PlatformIO/Projects/espurna-1.14.2.PA5/espurna/code/espurna/ntp.ino:220:54: error: invalid conversion from 'const char
' to 'int' [-fpermissive]
configTime(cfg_tz.c_str(), _ntp_server.c_str());
^
/home/oscar/PlatformIO/Projects/espurna-1.14.2.PA5/espurna/code/espurna/ntp.ino:220:55: error: too few arguments to function 'void configTime(long int, int, const char, const char, const char)'
configTime(cfg_tz.c_str(), _ntp_server.c_str());
^
In file included from /tmp/tmpGCxRSF:1:0:
/home/oscar/.platformio/packages/framework-arduinoespressif8266@2.20402.4/cores/esp8266/Arduino.h:295:17: note: declared here
extern "C" void configTime(long timezone, int daylightOffset_sec,
^
/home/oscar/PlatformIO/Projects/espurna-1.14.2.PA5/espurna/code/espurna/ntp.ino: In function 'void _ntpBrokerSchedule(int)':
/home/oscar/PlatformIO/Projects/espurna-1.14.2.PA5/espurna/code/espurna/ntp.ino:264:23: error: 'class Ticker' has no member named 'once_scheduled'
_ntp_broker_timer.once_scheduled(offset ?: 1, _ntpBrokerCallback);
^
**
[.pio/build/generic-esp01s-dht11-10-ota/src/espurna.ino.cpp.o] Error 1

please help
Oscar

Max Prokhorov
@mcspr
@karmacoma92 platform = arduino_core_2_4_2 does not support tz variable through configTime https://github.com/esp8266/Arduino/blob/bb28d4a3927758b0b345579792cdeebbc9e2e6a3/cores/esp8266/time.c#L58
if you insist on using 2.4.2, you might want to modify the code to match the recent version of it https://github.com/esp8266/Arduino/blob/f066ed2495c8d6f04841243d90f6deaef21a0119/cores/esp8266/time.cpp#L135
but you will still have an issue with ticker, see libraries/Ticker in the same tree
karmacoma92
@karmacoma92

hi again, this time I'm facing this:

[163904] [WEBSERVER] Request: GET /auth
[163939] [WEBSOCKET] #1 connected, ip: 192.168.4.2, url: /ws
[164086] [WEBSOCKET] #1 error(1002): Invalid UTF-8 in text frame"ipL�- $ ' mask","dns","stored"],"networks":[]},"max":5}
[164089] [WEBSOCKET] #1 disconnected
[165659] [WEBSERVER] Request: GET /index.html
[165789] [WEBSERVER] Request: GET /auth
[165812] [WEBSOCKET] #2 connected, ip: 192.168.4.2, url: /ws
[165962] [WEBSOCKET] #2 error(1002): Invalid UTF-8 in text frame"9f␟�� j␁
[165964] [WEBSOCKET] #2 disconnected
[166904] [WEBSERVER] Request: GET /index.html
[167031] [WEBSERVER] Request: GET /auth
[167055] [WEBSOCKET] #3 connected, ip: 192.168.4.2, url: /ws
[167205] [WEBSOCKET] #3 error(1002): Invalid UTF-8 in text frame
[167207] [WEBSOCKET] #3 disconnected

after trying with "platform = ${common.arduino_core_2_6_3}", any hints?
Thanks once more
Oscar

BTW, it doesn't allow me to change almost nothing but the password
Jeremy White
@jwhite
Trying to build under platform.io
and getting this error :

ompiling .pio\build\arilux-al-lc02\lib77b\ESP Async WebServer\WebAuthentication.cpp.o

include "sdkconfig.h"

                   ^

compilation terminated.
* [.pio\build\arilux-al-lc02\libb1a\AsyncTCP_ID1826\AsyncTCP.cpp.o] Error 1

any ideas?
Jeremy White
@jwhite
added this the the platform.io config
and it seems to fix it
Max Prokhorov
@mcspr
@karmacoma92 can you share the resulting .elf & .bin? from .pio/build/envname
karmacoma92
@karmacoma92

hi, unfortunately I have deleted old .elf & .bin, and I have replaced them with new ones, but something strange is still happening since it doesn't allow me to add any new wifi network and it still not appearing any sensors fields:

STATUS
Current configuration
Manufacturer
GENERIC
Device
ESP01S_DHT11_10
Chip ID

Max Prokhorov
@mcspr
do you have WIFI<NUM>_... flags set?
Max Prokhorov
@mcspr
also see https://github.com/xoseperez/espurna/issues/2104#issuecomment-573847037 if you had no issues with 2.4.2 connectivity
selecting sdk 2.2.1 might help, erase.config command too. so far I am not seeing any issues with communication, but what you are describing may be explained by missing ws packets. like when you can't create network and it says "Max number of networks reached", for some reason that message was lost (part of which you have seen in the ws log as error(1002): Invalid UTF-8 in text frame"ipL�- $ ' mask","dns","stored"],"networks":[]},"max":5})
karmacoma92
@karmacoma92
do you have WIFI<NUM>_... flags set? - not that I know
karmacoma92
@karmacoma92
erase.config does not help at least not with the format I used it "ERASE.CONFIG"
karmacoma92
@karmacoma92
I don't know how to select "sdk 2.2.1"
karmacoma92
@karmacoma92
sorry i just noticed -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK221
karmacoma92
@karmacoma92
hi, no luck with sdk 2.2.1
[094930] [MAIN] CPU chip ID: 0x8E1600
[094933] [MAIN] CPU frequency: 80 MHz
[094936] [MAIN] SDK version: 2.2.1(cfd48f3)
[094940] [MAIN] Core version: 2.6.3
[094943] [MAIN] Core revision: 3d128e5c
[094947] [MAIN] Build time: 1582319254
karmacoma92
@karmacoma92

I just noticed it keeps on rebooting
ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1392, room 16
tail 0
chksum 0xd0
csum 0xd0
v3d128e5c
~ld

ets Jan 8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1392, room 16
tail 0
chksum 0xd0
csum 0xd0
v3d128e5c
~ld
[000184]

karmacoma92
@karmacoma92

After erasing the flash and flashing the latest build back it does still happen

[WEBSERVER] Request: GET /auth
[051035] [WEBSOCKET] #1 connected, ip: 192.168.4.2, url: /ws
[051178] [WEBSOCKET] #1 error(1002): Invalid UTF-8 in text frame
[051181] [WEBSOCKET] #1 disconnected
[054080] [SENSOR] Error reading data from DHT11 @ GPIO2 (error: 3)
[060005] [MAIN] System OK

I could only change the password, no wifi, nothing

thanks
Oscar
Max Prokhorov
@mcspr
@karmacoma92 i'll try to check sensor config some time later, but I don't remember having any issues a week ago with it loading webui. keeping on with the debug - can you send the resulting .elf? only one device has this issue or all of 2.6.3 Core builds? any way you can capture http session with wireshark / tcpdump so we can see exactly the way frames are sent?
karmacoma92
@karmacoma92

can you send the resulting .elf?
sure, where shall I sent it to?

only one device has this issue or all of 2.6.3 Core builds?
as far as I know relays doesn't have any issue but I haven't tested any more

any way you can capture http session with wireshark / tcpdump so we can see exactly the way frames are sent?
good idea, please let me know where shall I upload it

thanks once more
Oscar

(via attach file)
Muhammad Rabieh
@Muhammad-Rabieh

I'm developing an Android app that supposed to send PUT request to espurna and when I try the same request using curl, I get success response, but from the Android app I get 404 error with PUT request, here is the request for both from mobile app and curl, I listened to both requests on my PC using netcat

user@Laptop:~$ nc -l 192.168.1.104 55555
PUT /api/relay/0 HTTP/1.1
Host: 192.168.1.104:55555
User-Agent: curl/7.58.0
Accept: application/json
Content-Length: 31
Content-Type: application/x-www-form-urlencoded

apikey=2E5DE48567FB10F2&value=1


user@Laptop:~$ nc -l 192.168.1.104 55555
PUT /api/relay/0 HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
User-Agent: Dalvik/2.1.0 (Linux; U; Android 9; HRY-LX1MEB Build/HONORHRY-LX1MEB)
Host: 192.168.1.104:55555
Connection: Keep-Alive
Accept-Encoding: gzip
Content-Length: 31

apikey=2E5DE48567FB10F2&value=1

here is my android java request

public void jsonRequestVolley(int method, String url, String requestBody) {         
        RequestQueue queue = Volley.newRequestQueue(context); 

        JsonObjectRequest jsonRequest = new JsonObjectRequest(   
                method,                           
                url,                                            
                requestBody,
                successResponse(),  
                errorResponse()   
        )  
        {

            /**
             * Passing some request headers
             * */
            @Override
            public Map<String, String> getHeaders() {
                HashMap<String, String> headers = new HashMap<String, String>();
                headers.put("Accept", "application/json");
                return headers;
            }

        };

        queue.add(jsonRequest);
    }

the working curl command is

curl -X PUT -H "Accept: application/json" http://192.168.1.105:55555/api/relay/0 --data "apikey=2E5DE48567FB10F2&value=1"

```