ShIoTiny: Updates and Notifications





What is this article about



We continue the series of articles on ShIoTiny - a visually programmable controller based on the ESP8266 chip.



This article talks about what has changed since the previous ShIoTiny firmware: how the user interface has changed; how to reassign “legs” and other less important, but no less long-awaited things.



The article presents something like a “ fact sheet ” on the state of affairs in the field of ShIoTiny firmware development . Those who are not interested in my development of this article can skip this article with a clear conscience.



Those who do not know what they are talking about, but want to find out, can read my previous articles on ShIoTiny firmware or refer to the documentation .



ShIoTiny Project Site



The online version of the ElDraw editor is exactly the same as in the firmware, for reference.



Links to schematics, firmware, and more - on the ShIoTiny website in the documentation section.



Previous ShIoTiny Articles and My Other Articles



Intro to reassure the venerable public



It just so happened that the fourth quarter is a permanent rush. Therefore, some comrades have already begun to bury the ShIoTiny project and write to me in the mail, they say - “hey, author, where are you ?! Why do not you write?! we are using your firmware here! and you are not a single new article! "

Of course, that was in a polite manner, but in terms of meaning it was. Some, on the contrary, wrote suggestions and comments, which helped a lot in catching software fleas. Thank you guys. It is always nice that you do not cook in your own juice, but have like-minded people.



Friends! I remind you that my project is a hobby and besides it I have a job, a wife and kids. So I beg you: be lenient! The author writes how he can and can :)



I hasten to reassure everyone: the project is not dead ! I caught quite a few fleas from the code and, in addition, redid the project site (though I still haven’t finished it - I fill the site with content).



From the point of view of most philosophical teachings in the world there is nothing permanent. Even our universe is evolving. What can we say about microcontroller firmware or the project website?



The key changes in the ShIoTiny firmware touched primarily two things: the ability to redefine the legs and the controller status page. We’ll talk about them. As for the new design of the project’s site, I won’t touch it here: anyone who is curious will come by, look and criticize.



Redefining ESP8266 Legs



So, the legs or they are - GPIO . Initially, the ESP866 microcontroller legs were not intended to be redefined. They were rigidly nailed to the inputs and outputs of the ESP-07 board (anyone interested - everything about it is on the project website).



But suddenly it turned out that my firmware without any modification goes not only on the ESP-07 module with 1MB FLASH, but also on the ESP-01 , ESP-12 and even on the ESP-8285 !



The question arose rightly that one needs 5 inputs and one output, the other 6 outputs and no inputs, and the third three thermometers at the same time.



A wave of letters from the indignant public almost darkened the remnants of my mind! My wife was already preparing to call me orderlies with a death shirt ... But I was a tough nut!

Gritting my teeth and drinking three liters of coffee, I collected the remnants of the brain, which by chance were not drunk in the student body, and figured out how to implement the trick with redefining the legs so that everyone would feel good.



I will not bore the reader with the internal program kitchen. From the user's point of view, everything looks extremely simple: he pokes the mouse on a node that is connected to any leg of the GPIO module and selects one leg from the list of possible ones. Something like the picture below.







N / A - means that the foot is not selected.

If there is a node in the circuit with an N / A leg not selected, then such a circuit cannot be loaded into the device - the ElDraw editor will not allow it . But such a scheme can be downloaded to disk to continue editing it “sometime later”.



Everything is very simple, but there are nuances.



Firstly , which is very convenient in my opinion, only unused legs are displayed in the list. That is, choosing one leg twice is impossible.



Secondly , the GPIO15 leg is reserved for the AP button and cannot be used for other purposes. Sorry, but otherwise - no way ...



Thirdly , the GPIO16 leg cannot be used as a regular binary input ( Input node).



Fourth , the GPIO9 and GPIO10 legs can only be used on the ESP-8285 module. On other modules, the result will be disastrous - full dependency and endless reboot!



The last point - the hang of some modules when choosing the GPIO9 and GPIO10 legs made me think hard. After all, I do not want to alter the controller every time if the legs are selected incorrectly! And I came up with a modified, new way to go into configuration mode.



New way to enter configuration mode



If someone read my previous articles, then he remembers that the ShIoTiny firmware configuration mode is the mode when the ESP8266 chip becomes an open access point, and the program circuit does not start automatically after rebooting. And if it does not start, then it will not hang when choosing any GPIO legs.



That is, in configuration mode, you can change the problem legs of GPIO9 and GPIO10 to others. But the trouble is, you could get into configuration mode only by holding the AP button for about 4 seconds! And during this time, the controller will have time to start executing the “curve” circuit program and freeze!



To resolve this problem, I came up with a half-second guard interval after rebooting the controller. If the AP button is pressed within 0.5 seconds after rebooting the controller, the controller will immediately reboot in configuration mode. At the same time, during the half-second guard interval, the program scheme does not start. And that means it can’t hang.



The disadvantages are obvious - the program does not start immediately, but half a second later. The advantages are much more solid - if the “wrong legs” are selected or the program circuit freezes for some other reason, then you can always go into configuration mode and correct the situation without flashing the controller.



In practice, everything looks simpler than a steamed turnip: we press the Reset button and, releasing the Reset button right there, without interfering, we press the AP button. Immediately for about half a second the blue STATUS LED lights up (if you, of course, soldered it to GPIO0 ) and the controller will reboot in configuration mode.



If the program circuit works normally, then you can always switch to the configuration mode in the “old” way - by pressing and holding the AP button for about 4 seconds (until the blue STATUS LED lights up).



ShIoTiny Status Page



The ability to connect the legs by the will of the user has led to a revision of the main information page of the ShIoTiny firmware.



After heavy deliberation, I came to the conclusion that the page should be a) informative and b) not contain too much.



What I got is shown in the figure below.







There are two sections on the main information page: Info - general information and Used GPIOs - information on the use of I / O legs. Let's consider them in more detail.



Info Section



Name: esp_8266_155da4 - a unique name for the device. It is generated automatically and cannot be changed.



Ver: 2019-10-22 22:54:51 +0700 6b5ee82 clean - firmware version (build date and commit identifier).



MQTT: Connected to: 192.168.1.2:21064, SSL - connection to the MQTT server. Shows the server’s IP address or URL, server port, and SSL mode if a secure connection is being used. Remember that if the circuit program does not contain nodes for working with MQTT, then the connection will never be established!



WiFi: STA ip: 192.168.1.134. - WiFi ESP8266 operating mode: STA - station, AP - access point. Both modes with different IP addresses can be selected at the same time.



Now: Wed Oct 30 2019 21:49:28 GMT + 0700 - current time. It is shown there is only time set by the Set Time node! Otherwise, it will be indicated that the time is not synchronized and not set.



Used GPIOs Section



This section shows all the module legs used in the program diagram and their current status.



The output format is obvious: GPIO <leg number> (function): status

The leg number is the number or, for the ADC , instead of the number will be the inscription adc .

Function: Input - binary input; Relay - binary output; ADC - ADC or sensor type: DS182x or DHTxx .



Field “state” - depends on the purpose of the leg.

For binary inputs and outputs - 0 or 1.

For sensors - temperature, humidity.

For the ADC - its readings recalculated according to the given formula (see the description of working with the ADC in the instructions).



In my opinion, the main page contains all the necessary information about the controller.



Conclusion



Here, in fact, are all the major changes in the firmware today. In addition to these innovations, dozens of five minor errors were fixed.



As usual - detailed instructions on the ShIoTiny website in the documentation section or here .



Suggestions, wishes, criticism, money, gifts and so on - send me a comment or e-mail: shiotiny@yandex.ru .



Waiting for feedback and suggestions.



All Articles