For WPS to work on the ESP8266 and using the non-OS SDK, be sure to call wifi_wps_enable() before setting the callback function with wifi_set_wps_cb(). For example: In the callback itself, call wifi_wps_disable() before wifi_station_connect(). For example:
Author Archives: Eddy Young
ESP8266: Flash images at more than 115200 bps
If esptool is limited to 115200 bps when flashing your firmware to an ESP8266, you can try to increase the bitrate by following the steps below. Locate esptool.py for your installation. On Debian and Ubuntu, this file is located in /usr/share/esptool. Edit esptool.py and change the value on the line starting with ESP_ROM_BAUD from 115200 …
Continue reading “ESP8266: Flash images at more than 115200 bps”
ESP8266: Always call `uart_init` before `gpio_init`
I don’t remember if this information is in the documentation, but having spent a few hours to figure things out, I think it is important to record it here. For example:
ESP8266 ESP-01(S) requires CH_PD set to HIGH
On the ESP8266 ESP-01, CH_PD must be pulled HIGH at boot for the chip to work. A 10K resistor can be used for the pull-up. Some variants of the ESP-01 module already have CH_PD in the HIGH state.
Remember, C# does not have an exponent operator
I want to share an anecdote of confusing programming language features as a caution to my fellow programmers. Reviewing our application logs, I noticed that the API requests were interspersed with pauses of irregular durations. The interval between each successful request is supposed to be fixed; and the interval between each failed request, exponentially growing …
Continue reading “Remember, C# does not have an exponent operator”
Convert a value from scientific notation to decimal in T-SQL
A VARCHAR value that is in scientific notation can be converted to a DECIMAL value by first converting it to a REAL value, then to the DECIMAL value. For example: This also works with CAST.
Avoiding time drift in virtual machines
If you use a virtual machine, you might notice that its system time starts to lag after it has been powered on for a while. To solve this problem, it is useful to run an NTP (Network Time Prococol) client within the VM to have its time synchronised regularly. On Windows, automatic time synchronisation is …
Caveat with AddInitialRequestCultureProvider() in ASP.NET Core
AddInitialRequestCultureProvider() in ASP.NET Core localisation seems to have an undefined behaviour when it is used in both services and application builder configurations to add a custom RequestCultureProvider. If you want to use a custom RequestCultureProvider to customise how the applicable culture is determined for an incoming HTTP request (for example, by looking up the chosen …
Continue reading “Caveat with AddInitialRequestCultureProvider() in ASP.NET Core”
How can you minimize the impact of the persistence layer on your domain models?
This post answers the question ‘How can you minimize the impact of the persistence layer on your domain models?’ posted on reddit /r/dotnet, showing how I would implement a solution in the purest OOP [sic] possible with C#. (Note: The factory and persistence classes are simplified for demonstration purposes.) So here is the code. It …
Continue reading “How can you minimize the impact of the persistence layer on your domain models?”
Solving vfprintf.c:(.text.avr-libc+0xc8): undefined reference to ‘__mulqi3’ linking error
If you encounter the above linking error with an ATmega328p and your code uses sprintf, set your LIBRARY_PATH or the linker argument -L to /usr/lib/avr/lib/avr5 instead of /usr/lib/avr/lib.