New release 1.44.2 for ESP8266

Here you'll find the updated available
User avatar
cicciocb
Site Admin
Posts: 2194
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 470 times
Been thanked: 1461 times
Contact:

Re: New release 1.44.2 for ESP8266

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat May 21, 2022 1:06 pm Just checking in case support for hardware wake-up from sleep might be included but not documented ?
Hi Robin,
this is already supported with the command SLEEP and using the RST pin to wake-up the chip.
The wake-up from any other pin is not supported by the chip itself.
User avatar
Electroguard
Posts: 945
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 310 times
Been thanked: 352 times

Re: New release 1.44.2 for ESP8266

Post by Electroguard »

this is already supported with the command SLEEP and using the RST pin to wake-up the chip.
The wake-up from any other pin is not supported by the chip itself.
Thanks Francesco.
If I'm understanding it correctly though, it's not actually a hardware wake-up, it's a software wake-up triggered only by sleep time-out, not by an external sensor trigger. So I don't think it can be externally hardware triggered by eg: a radar sensor, like Annex 32 can... but was just checking to make sure, cos my work-around would be a bit clunky.

If 8266 cannot be triggered out of sleep, then next best thing will be to turn it off completely and boot it up from a hardware trigger.
In tests it powers up and UDP's msg to make Sentry alarm speak an alert message about 5 seconds after being plugged in, so that would be ok.

Needs to be solar powered 24/7, even in darkest winter.
So am thinking of using wemos D1 mini pro cos of external aerial connector plus can have wemos relay shield plus DC power shield from solar battery.
I'm thinking of powering the wemos 5v via a relay which can be turned on by the radar sensor then held on by the 8266 until it is put to sleep after doing whatever it needs to do, which would drop relay power and turn it off. Presumably it should start up ok again at power-up and not even know it was put to sleep. Glad of any other suggestions ?
radar.jpg

Can put them in flower pots and garden gnomes, or these dummy cctv cameras... except their solar panels not very big;
https://www.aliexpress.com/item/1005003 ... 901%21sea

Whereas this has a big solar panel with battery inside:
https://www.aliexpress.com/item/1005004 ... 1683%21sea

It has a waterproof DC jack connector for connecting to a pump, but that would allow it to be plugged straight into into a Wemos DC Power Shield:
https://www.aliexpress.com/item/3283516 ... 5855%21sea

EDIT: drawing error, 5v should be going to Vin on radar module.
You do not have the required permissions to view the files attached to this post.
User avatar
cicciocb
Site Admin
Posts: 2194
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 470 times
Been thanked: 1461 times
Contact:

Re: New release 1.44.2 for ESP8266

Post by cicciocb »

Robin,
the ESP8266 can be woken from sleep simply doing a reset.
In fact the connection between the pin GPIO16 and the RST pin is required only if the module must be woken after a given time.

Simply put the module in deep sleep (with the command SLEEP and 0 as value) and then the module can be woken putting a LOW on the RST pin.


this is what the help states

Code: [Local Link Removed for Guests]

SLEEP value
Put the ESP in deep sleep (low energy) for 'value' seconds.
At the end of the period, the unit will reboot and reload the default basic program.
Note : GPIO16 must be connected to RST pin to wakeup from sleep
NOTE: Maximum time is 4294 seconds (around 71 minutes)
It is possible to know if the module has been woken-up from the deep sleep using the function BAS.RESETREASON.
User avatar
Electroguard
Posts: 945
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 310 times
Been thanked: 352 times

Re: New release 1.44.2 for ESP8266

Post by Electroguard »

Yes, that's what I thought, but would then need to invert the radar trigger to be active low reset, so would still need additional hardware.
I see what you are saying though, active low reset is actually a hardware wake-up from sleep.

It's not a problem Francesco, I only asked about hardware sleep wake-up because I thought it had been discussed with somebody else quite a while ago, but perhaps that had been about the Annex32 implementation.

Relay power-up has the advantages that the ESP will draw zero current until it powers up, and won't ever slip into a coma, so I'm happy with that.
User avatar
cicciocb
Site Admin
Posts: 2194
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 470 times
Been thanked: 1461 times
Contact:

Re: New release 1.44.2 for ESP8266

Post by cicciocb »

Robin, your solution is a very good idea, you might eventually replace the relay with a mosfet for reducing more the power.
I remember that the Guy with a swiss accent shows something in that sense in a video about LORA.

I was just focusing about the wake up of the module that is supported only using the RST (and not using other pins like the ESP32)
sidi
Posts: 1
Joined: Mon May 30, 2022 10:42 pm

Re: New release 1.44.2 for ESP8266

Post by sidi »

This is amazing!
Thanks to the author!
1) But we don't understand how to update the version?
We downloaded a file with the "bin" extension, and what should we do next with this "bin"?
2) You are older students, and we want to make a "programmable graphical calculator" for younger students with an OLED screen and 45 buttons.
We need a function that can execute any BASIC code from text. For example like this:
Variable = EValue("program text")
We also need a function that will allow us to put a C ++ piece (function or library) into Flash and execute it from Basic
If it was open source, we could easily add it ourselves.
However, the author for some reason does not want to receive help from other enthusiasts and it remains to ask him to make additions.
These are very important additions that will greatly expand the interest in this wonderful product.
3) How can I join the development team? We have a lot of interesting ideas, what else can be added to control robots and toys and for the school educational process.

It's all wonderful!
But very few people on the forum downloaded (only 60).
Let's develop together with the students.
It will become fashionable - There will be a lot!
User avatar
Electroguard
Posts: 945
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 310 times
Been thanked: 352 times

Re: New release 1.44.2 for ESP8266

Post by Electroguard »

Hi, CiccioCB is the author and I expect he will reply when he gets a chance.

Firstly, C++ is a compiler, whereas Annex is a BASIC interpreter.
The compiler effectively runs in unlimited computer memory, and C++ scripts effectively have unlimited storage space, while the uploaded compiled executable code effectively has the entire device resources to itself, and only consists of just the code that is required for that particular use.

All of the capabilities of Annex (whether used or not) are squeezed onto the device resources, including the Annex BASIC interpreter along with all the required drivers for all of its capabilities, which shares space for file storage for all of the uploaded scripts, plus Over The Air bootloader.

The capabilities of Annex are amazing, and it is CiccioCB who is the wizard who has achieved that minor miracle, so any future justifiable development needs to be expertly squeezed into the few remaining invaluable resources without causing any Buckaroo disasters... which is most certainly not something to be hacked at by anyone else, any more than the C++ compiler is open to be hacked by community development.

What the limited resources of Annex can do is amazing, but it's never going to run linux.
So once the limits of Annex are accepted, a bit of ingenuity can usually find ways to work around what it cannot do.
For instance, why waste valuable resources adding INC(n) function when n=n+1 will suffice.
And there are many ways to easily connect multiple cheap devices together to add greater distributed functionality, and not necessarily all Annex devices.
If I wanted Annex to execute some compiled C++ code I would probably use Annex to boot up and control another arduino device using serial.
And just to be clear, Annex is not a C++ compiler so obviously it cannot actually run any C++ code or libraries.
But Annex can run javascript code, which offers huge potential.
It can also 'launch' other Annex scripts, so can be used as a menu for launching different apps:
https://sites.google.com/site/annexwifi ... -oled-menu

I have many Annex devices running 24/7 on my own bespoke automation and control systems.
If it works, I don't touch it... cos all that can come from upgrading an already reliable working system is to introduce problems.

The flasher looks for a specific filename in the Annex Toolkit 'build' folder.
So firmware updates need to be copied into the Annex Toolkits 'build' folder, over-writing the previous .bin file of the same name.
You might want to rename the old version first though, so that you can revert back to that previous version if ever necessary.

You can use the COMMAND instruction to execute any valid text instructions.
If you look at the last subdir of this Calculator script you can see how the = button evaluates code input by pressing other buttons.
https://sites.google.com/site/annexwifi ... calculator

Many of your questions have already been asked and answered, so you have a lot of reading to do.
There is much that can be learned from the many examples... and perhaps you and your students may even contribute something yourselves.
User avatar
cicciocb
Site Admin
Posts: 2194
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 470 times
Been thanked: 1461 times
Contact:

Re: New release 1.44.2 for ESP8266

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue May 31, 2022 11:15 am This is amazing!
Thanks to the author!
1) But we don't understand how to update the version?
We downloaded a file with the "bin" extension, and what should we do next with this "bin"?
2) You are older students, and we want to make a "programmable graphical calculator" for younger students with an OLED screen and 45 buttons.
We need a function that can execute any BASIC code from text. For example like this:
Variable = EValue("program text")
We also need a function that will allow us to put a C ++ piece (function or library) into Flash and execute it from Basic
If it was open source, we could easily add it ourselves.
However, the author for some reason does not want to receive help from other enthusiasts and it remains to ask him to make additions.
These are very important additions that will greatly expand the interest in this wonderful product.
3) How can I join the development team? We have a lot of interesting ideas, what else can be added to control robots and toys and for the school educational process.

It's all wonderful!
But very few people on the forum downloaded (only 60).
Let's develop together with the students.
It will become fashionable - There will be a lot!
Hi, first of all thanks to Robin (Electroguard) for his answer.

Hi sidi,
thanks for your interest for Annex, I'm happy to hear that schools and student find an interest into Annex.
I confirm that the EValue() function exists and is named COMMAND() as Robin said.
About the possibility to integrate libraries and C++ code, this can only be done implementing these functions inside the Annex core, and is what I do regularly following in general requests coming from the users.
I'm not very keen to open the source code as I think that this will only generate a multitude of different versions with different functions, probably different limitations and crashes and even incompatible between them.
In addition this will generate extra work for me as I'll be obliged to fully document the development process and support / help people into the integration of new features and compilation process.

I prefer to have one unique version for the benefit of everybody and not a lot of custom versions.

So, to resume, I'm open to receive suggestions and improvements and eager to implement them if this are useful for the community.

Regards,
cicciocb
efalken
Posts: 51
Joined: Tue Mar 02, 2021 3:47 pm
Has thanked: 25 times
Been thanked: 33 times

Re: ESP8266 external wakeup

Post by efalken »

Hi there,
I have build an ESP8266 into a smoke detector (battery driven).
The chip is only triggered by an external event (short pulse).
Then the code keeps the power supply running, until the code switches the device of again.
I came up with this solution:

Image

I used a dual mosfet IRF7319 that is very small so everything is fitting into the case easily.
The chip works at logic level voltage and the diodes are preferably schottky because of their low voltage drop.
You do not have the required permissions to view the files attached to this post.
User avatar
Electroguard
Posts: 945
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 310 times
Been thanked: 352 times

Re: New release 1.44.2 for ESP8266

Post by Electroguard »

Thanks for the circuit diagram efalken.
If you include the script and sensor details it could be a useful addition to Projects.
The relay circuit does actually work by the way, the relay is only on for the few seconds it takes to transmit the alert message, then it is switched off (rather than put the esp into sleep).
But I've also ordered some mosfets anyway.
Post Reply