radio-controlled sockets HX2262 PT2262

Code tips and tricks for beginners
User avatar
Oli
Posts: 78
Joined: Tue Feb 09, 2021 10:07 am
Location: Germany, Meissen
Has thanked: 18 times
Been thanked: 54 times
Contact:

Re: radio-controlled sockets HX2262 PT2262

Post by Oli »

hi,
I have tested further, the firmware can be installed, but only starts as an AP if I do not write the set config configuration form.

as soon as i write nvs it will not work. most of the test time i wrote this and it never worked

when I log into the AP, I can also work very well with the config.html

but when it reboots, it won't connect to the router, it tries until the dots are behind, but opens an AP, but without DHCP or false, I can't access it with 192.168.4.1, it uses the IP intended for the router, I can never access it again.

but with the old versions the procedure worked and connected the router, i will now try to use the dhcp from the router, but with the variety of my devices it should be fixed,

i have now verified it again, the new versions do not connect to the router, the old ones are always 100% secure. the router is 3m away,
i also changed the router's radio channel, without success
I had already considered the power requirements,
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 2383
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 498 times
Been thanked: 1675 times
Contact:

Re: radio-controlled sockets HX2262 PT2262

Post by cicciocb »

I think that your should check your IP parameters as the subnet mask and the gateway seems wrong.

I think they should be 255.255.255.0 and 192.168.1.250.

About the wifi connectivity, It is hard to support you as all my esp32-C3 modules (including the one you have) works well and nothing changed on the wifi side with the last version 1.60.3.

I remember that someone else reported something similar at you issue, and they fixed the problem restarting the WIFI router.

It could be interesting to know if someone else has the same problem ....

These are the ESP32-C3 modules I have :
image.png
You do not have the required permissions to view the files attached to this post.
User avatar
Electroguard
Posts: 1028
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 335 times
Been thanked: 378 times

Re: radio-controlled sockets HX2262 PT2262

Post by Electroguard »

Like Francesco says Oli, your IP configuration is incorrect.
The gateway should be the IP address of your wifi router, and if that is on subnet 192.168.1, then the static IP of any devices needing to connect to the router in STation mode must also be on that same subnet (ie:192.168.1 instead of 192.168.0) else they will not be able to connect.
And unless you are doing something non-standard with the subnet, the subnet mask should be 255.255.255.0 (not 255.255.254.0)
If the device was configured as its own independent AP access point then it would not be trying to connect to the router so those configuration differences would not have been relevant or caused problems.
User avatar
Oli
Posts: 78
Joined: Tue Feb 09, 2021 10:07 am
Location: Germany, Meissen
Has thanked: 18 times
Been thanked: 54 times
Contact:

Re: radio-controlled sockets HX2262 PT2262

Post by Oli »

hi,
my IP addresses for years
are 192.168.0.1 - 192.168.0.254 * 255.255.255.0

at the moment i have more than 250 devices in the network, 192.168.0.1 - 192.168.0.255 + 192.168.1.1 - 192.168.1.255 * 255.255.254.0 the DHCP is in the 192.168.0.X range, I set all smart devices to 192.168.1.X, i.e. 512 devices

but i plan to go as far as 192.168.4.1 with 255.255.252.0.
so up to 1000 devices, I hope I haven't made a mistake in my thinking

But I was able to solve the problem :D
now i soldered a 3cm cable to it, and bridged the capacitor, together with the piece of PCB 3,12cm so lamda 1/4 of 2,4Ghz. and it worked immediately. I have no idea why the older versions still worked well. even longer distances, and the current ones can't bridge the 3m to the router, is there perhaps something initialized differently?

i have also tested the older board of mine, which worked perfectly before, i noticed the same behavior, i never thought about range before, because it just worked in a 30m environment.

the bootloop and other behavior can be explained by the interference of the radio signal in the oscillator and chip, perhaps also by increased current consumption due to the non-tuned HF

dies habe ich auch gefunden dazu:
https://roryhay.es/blog/esp32-c3-super-mini-flaw

thank you all for your help, now I can get back to work properly,

but what i wish for:
that the IP settings apply as before, but in case of no connection and emergency start as AP go to a reachable connection where the smartfone gets dhcp, so 192.168.4.1 2 separate settings, for 1 for AP (mostly DHCP), and 1 for routers
You do not have the required permissions to view the files attached to this post.
Last edited by Oli on Mon Sep 16, 2024 10:28 am, edited 3 times in total.
User avatar
Oli
Posts: 78
Joined: Tue Feb 09, 2021 10:07 am
Location: Germany, Meissen
Has thanked: 18 times
Been thanked: 54 times
Contact:

Wifi Range

Post by Oli »

Here are the 3 versions:

above: 3cm cable, super range i scan wifi from 200m distance

middle: 90 degree rotated antenna, 13db worse than above, I receive 15m

bottom: original, I see aHF short circuit, the hot antenna side radiates directly into the crystal, I can't connect to the router 3m away, the AP at 30cm to the smartfone still worked,
You do not have the required permissions to view the files attached to this post.
lyizb
Posts: 179
Joined: Fri Feb 12, 2021 8:23 pm
Has thanked: 82 times
Been thanked: 60 times

Re: radio-controlled sockets HX2262 PT2262

Post by lyizb »

Are you saying that with the ESP32-C3-SuperMini, if you remove the red component labelled "C3" and solder a 3cm wire to the upper pad (when the USB-C port is to the left), then you get increased range to 200M?

That could solve some intermittent connectivity issues I am having. There are enough pins for almost anything I do, and the price is quite reasonable--$7.83USD for 4 here: https://www.aliexpress.com/item/1005001633363541.html
User avatar
cicciocb
Site Admin
Posts: 2383
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 498 times
Been thanked: 1675 times
Contact:

Re: radio-controlled sockets HX2262 PT2262

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sun Sep 15, 2024 9:06 pm hi,
my IP addresses for years
are 192.168.0.1 - 192.168.0.254 * 255.255.255.0

at the moment i have more than 250 devices in the network, 192.168.0.1 - 192.168.0.255 + 192.168.1.1 - 192.168.1.255 * 255.255.254.0 the DHCP is in the 192.168.0.X range, I set all smart devices to 192.168.1.X, i.e. 512 devices

but i plan to go as far as 192.168.4.1 with 255.255.252.0.
so up to 1000 devices, I hope I haven't made a mistake in my thinking

But I was able to solve the problem :D
now i soldered a 3cm cable to it, and bridged the capacitor, together with the piece of PCB 3,12cm so lamda 1/4 of 2,4Ghz. and it worked immediately. I have no idea why the older versions still worked well. even longer distances, and the current ones can't bridge the 3m to the router, is there perhaps something initialized differently?

i have also tested the older board of mine, which worked perfectly before, i noticed the same behavior, i never thought about range before, because it just worked in a 30m environment.

the bootloop and other behavior can be explained by the interference of the radio signal in the oscillator and chip, perhaps also by increased current consumption due to the non-tuned HF

dies habe ich auch gefunden dazu:
https://roryhay.es/blog/esp32-c3-super-mini-flaw

thank you all for your help, now I can get back to work properly,

but what i wish for:
that the IP settings apply as before, but in case of no connection and emergency start as AP go to a reachable connection where the smartfone gets dhcp, so 192.168.4.1 2 separate settings, for 1 for AP (mostly DHCP), and 1 for routers
Good to know, there are also other ESP32-C3 mini with a similar issue but I included a patch in the code for these modules.
image.png
image.png
For the IP configuration, the same IP is used for both STA or AP configurations so you can always use this IP when connecting to it iin AP mode.
You do not have the required permissions to view the files attached to this post.
User avatar
Oli
Posts: 78
Joined: Tue Feb 09, 2021 10:07 am
Location: Germany, Meissen
Has thanked: 18 times
Been thanked: 54 times
Contact:

Re: radio-controlled sockets HX2262 PT2262

Post by Oli »

hello,
the lamda 1/4 antenna is the simplest and best, because it has a direct 50 ohm foot resistance.
3cm cable + 0,13mm soldering point, is for 2,4GhZ

There are no losses due to conversion or cables. for very long ranges, a double quad directional antenna is also possible (several km).
the wire should be far away from other metal, especially at the upper end.
The Chinese have as much experience of HF as the English have of good food.
I have also used this cable with many wifi devices, camera etc.
You will also be surprised with any other module, a PCB antenna cannot be good.

regarding the components, there is confusion, the circuit diagram shows a resistor where a capacitor actually belongs, the 2 filters are never soldered in, the component marked C3 is supposed to be an antenna of the worst quality (there are some made of ceramic). the 3cm Lamda 1/4 does not need any of this,
You do not have the required permissions to view the files attached to this post.
User avatar
Oli
Posts: 78
Joined: Tue Feb 09, 2021 10:07 am
Location: Germany, Meissen
Has thanked: 18 times
Been thanked: 54 times
Contact:

ESP32C3 super mini WIFI

Post by Oli »

Hi,
the super range is given with the antennas. i have now also tested this with other modules, with PCB antenna, phenomenal!
but the connection to the router still breaks off, sometimes immediately, usually after 30 minutes.
sometimes the WIFI.STATUS goes to 6 sometimes it stays at 3. i have already tried a new router.
WIFI.CONNECT cannot reconnect either, only reset helps.
26/09/2024 00:48:32 => Connection Error
26/09/2024 00:48:32 => Connection OFF
26/09/2024 08:56:59 => Connection ON
26/09/2024 00:57:32 => Connection OFF
something like this is in the WLOG before the connection is finally disconnected,
the connection field fluctuates from red to green, if i stop the program at the green moment the connection remains.

now i have noticed that it only happens when i use GPIO20 and GPIO21,, e.g. for i2c of the oled. or also for serial2.
in another case I communicate with the CUL433 via UART, also there I changed to GPIO8 and 9 for Serial2, now it works.
is it possible that the esp gets some garbage data via the USB-UART bridge ?

are the TX RX pins really free to use ?

i didn't change anything, just put the i2c on GPOI 8 and 9, and already successes,
i don't want to exclude other things, but the test lasted over night, otherwise not 30 minutes.

i made the photo of the system according to the data sheets, how easy is it to find space for such information on the website, then i can do it and more in english. important information that you won't find elsewhere is here:
https://pcbartists.com/design/embedded/ ... ping-pins/
https://www.studiopieters.nl/esp32-c3-pinout/

cu Oli
You do not have the required permissions to view the files attached to this post.
User avatar
Oli
Posts: 78
Joined: Tue Feb 09, 2021 10:07 am
Location: Germany, Meissen
Has thanked: 18 times
Been thanked: 54 times
Contact:

Re: radio-controlled sockets HX2262 PT2262

Post by Oli »

Hi,

I have now tested 20 modules, all have problems with the wifi range. My antenna modification works well, but something is not right.
Bluetooth runs over the same antenna and works, and with the modification the wifi reception is very good, I scan wifi from 200m away.
But the transmission power is very bad, and so is the communication, and there are interruptions.

Can we somehow exclude that it is not due to any registers for the transmission power?

it only affects the C3 supermini, unfortunately I don't have any other C3s to test, but it works with the ESP32.
Post Reply