Chat freely about anything...

User avatar
By eriksl
#80663 Quick start guide for release 18.

  • flash the image
  • wait 1-2 minutes
  • scan ssid's with your phone, a new ssid called "esp" should appear on channel 1
  • connect to this ssid using password "espespesp"
  • point your phone's browser to http://192.168.4.1:24
  • you should get a page now, click "reset wlan configuration"
  • fill in the fields (ssid and passwd) and click "set"
  • now click "reset"
  • after this, the esp should connect to your own ssid

Please note some browsers try to be smart an accelerate the loading. The simple ESP's http server can't handle that very good. You may need to click links several times until they work.
User avatar
By eriksl
#80664 For setting I/O's use the "im" command.

im without arguments lists all I/O's, this may be more than can fit in the buffer (4096 bytes) so it may be truncated. Use im with an index (like im 0) to get all pins from I/O 0 (gpio) only.

To set an I/O use im with arguments:

im <i/o> <pin> <mode> <extra...>

Where <i/o> = 0 for the internal GPIO, 1 for some extra internal GPIO I/O's (RTC and ADC), 2-5 are optionally connected i2c I/O expanders and 6 is an optionally connected ledpixel string.
<pin> is the pin number
<extra...> depends on the pin mode
- use "disabled" to disable a pin (set it to highZ)
- use "dinput" for a digital input
- use "counter" to create a counter
- use "timer" to create a timer (periodically on/off)
- use "ainput" to create an analog input (works only on io 1, pin 1)
- use "pwm" to create a quasi-analog output with PWM (8-18 bits wide)
- use "i2c" to create i2c I/O's (SDA, SCL)
- use "uart" to define UART communication on a pin (works only on io 0, pin 1,2,3)
- use "lcd" to define a hitachi-style LCD
- use "trigger" to define a trigger (port is set to input, when it's activated, perform an action)
- use "ledpixel" to define a port to be used for led pixels (output) (the individual led pixels are configured on I/O 6)
- use "pwm2" to define an alternative PWM, using built-in PDM, which is only 8 bits wide but very high refresh.

If you don't know what's the syntax, type e.g. "im 0 0 pwm" and you will be told what to add.

There is also a "help" command.

Hope this will get you started, don't hesitate to ask.
User avatar
By holopaul
#80682 Success ! I managed to flash v18 "ota" adding the rboot file
Code: Select allesptool.py -p /dev/cu.wchusbserial1420 write_flash --flash_size 2MB-c1 --flash_mode dio 0x000000 espiobridge-rboot-boot.bin 0x001000 rboot-config.bin 0x002000 espiobridge-rboot-image.bin 0x1fc000 esp_init_data_default_v08.bin 0xfb000 blank1.bin 0x1fd000 blank3.bin

I played a bit with pwm, everything worked fine. This wasn't the case with "ledpixel"
When i try to set uart gpio2 as "ledpixel" with the following command :
Code: Select allim 6 2 ledpixel
i get the message "io 6 not detected" and in the terminal "iw" command lists this :
Code: Select allio[6]: led string@00
  not found
. What am I doing wrong? And a follow-up question, what is the string to talk to the leds?
thanks
User avatar
By eriksl
#80695 Good to hear it works!

Did you know you can configure the pwm width with the "pw" command? Default is 16 bits (values 0-65536 at 69 Hz) but you can change it. After change, config write and restart.

For led pixel you first need to configure which UART pin to use. It can use either GPIO 1, which is the TX pin of UART0 or GPIO 2, which is the TX pin of UART1.

To use GPIO 1 for your led string, use "im 0 1 ledpixel". Then do "cw" (config write) and "r" (reset). After that you will I/O 6 active.

Each "pin" on I/O 6 maps to one led pixel, max 16 at the moment due to design and memory restrictions. You need to configure each pin as "pwm" and then you can set r/g/b values to the "pins". Hex format is supported if you prefix it with "0x", so for yellow on the first led you'd do something like this:
- im 6 0 pwm
- cw
- r
- iw 6 0 0xffff00

(first three lines only the first time of course).

Please note there are various led pixel available that claim to be a ws2812b but aren't. That's no problem, the protocol is similar enough BUT some of them have an other configuration with what leds are available. Some of them have an extra white/warm white/extra warm white led and some of them only have a cool white and a warm white led (so you can mix your own white colour tone). Also some of them have the red and green led reversed.

To make this work, you can set I/O flags on each pin, to let the firmware know what type is connected.
- extended means this led pixel has four leds, w/r/g/b. The value for the white led is in the most significant bits, so use iw 6 0 0xff000000 to only enable the white led (full power).
- grb means r and g leds are the other way around
- fill8 means that including this led pixel, additionally 7 led pixels are driven with the same colour, to be able to use strings of more than 16 led pixels.

To set an I/O pin flag, for example:

- isf 6 0 grb
- cw
- r

One final note. The led pixel support is designed to have the GPIO pin only control a stronger source that in turn drives the led pixel. For short distances that may not be required, but I've seen it not working correctly when I used an UTP cable of 4-5 meters because the capacitance of the leads being too high for the ESP to drive strong enough at the required frequency.

That is why the code assumes an external driver is connected, an inverting one (because they're most used). If you're going to insert any inverting device (I recommend an inverting schmitt trigger for small distances to eliminate the notorious noise from the ESP pins, or a mosfet driver for larger distances, like ir4426) you'll be OK. If you're planning to leave it out completely, I'll have to add an option to invert the signal in software. Which is possible and not a big deal, just yell.