AtomS3 Lite Programming

That’s fair, I’ll provide as much as I can.
ESPHome Log:

INFO Reading configuration /config/atoms3-07.yaml...
INFO Starting log output from 192.168.50.65 using esphome API
INFO Successfully connected to 192.168.50.65
[19:29:40][I][app:102]: ESPHome version 2023.2.1 compiled on Feb 20 2023, 21:07:54
[19:29:40][C][wifi:504]: WiFi:
[19:29:40][C][wifi:362]:   Local MAC: [redacted]
[19:29:40][C][wifi:363]:   SSID: [redacted]
[19:29:40][C][wifi:364]:   IP Address: 192.168.50.65
[19:29:40][C][wifi:366]:   BSSID: [redacted]
[19:29:40][C][wifi:367]:   Hostname: 'atoms3-07'
[19:29:40][C][wifi:369]:   Signal strength: -32 dB ▂▄▆█
[19:29:40][C][wifi:373]:   Channel: 9
[19:29:40][C][wifi:374]:   Subnet: 255.255.255.0
[19:29:40][C][wifi:375]:   Gateway: [redacted]
[19:29:40][C][wifi:376]:   DNS1: 0.0.0.0
[19:29:40][C][wifi:377]:   DNS2: 0.0.0.0
[19:29:40][C][logger:293]: Logger:
[19:29:40][C][logger:294]:   Level: DEBUG
[19:29:40][C][logger:295]:   Log Baud Rate: 115200
[19:29:40][C][logger:296]:   Hardware UART: UART0
[19:29:40][C][bluetooth_proxy:065]: Bluetooth Proxy:
[19:29:40][C][bluetooth_proxy:066]:   Active: YES
[19:29:40][C][esp32_ble:214]: ESP32 BLE:
[19:29:41][C][esp32_ble_tracker:583]: BLE Tracker:
[19:29:41][C][esp32_ble_tracker:584]:   Scan Duration: 300 s
[19:29:41][C][esp32_ble_tracker:585]:   Scan Interval: 1100.0 ms
[19:29:41][C][esp32_ble_tracker:586]:   Scan Window: 1100.0 ms
[19:29:41][C][esp32_ble_tracker:587]:   Scan Type: ACTIVE
[19:29:41][C][esp32_ble_tracker:588]:   Continuous Scanning: True
[19:29:41][C][captive_portal:088]: Captive Portal:
[19:29:41][C][mdns:108]: mDNS:
[19:29:41][C][mdns:109]:   Hostname: atoms3-07
[19:29:41][C][ota:093]: Over-The-Air Updates:
[19:29:41][C][ota:094]:   Address: 192.168.50.65:3232
[19:29:41][C][ota:097]:   Using Password.
[19:29:41][C][api:138]: API Server:
[19:29:41][C][api:139]:   Address: 192.168.50.65:6053
[19:29:41][C][api:141]:   Using noise encryption: YES
[19:30:17][D][esp32_ble_tracker:238]: Starting scan...

My yaml is:

esphome:
  name: atoms3-07
  friendly_name: atoms3-07

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "[redacted]"

ota:
  password: "[redacted]"

wifi:
  ssid: "[redacted]"
  password: "[redacted]"
  manual_ip:
    static_ip: 192.168.50.65
    gateway: [redacted]
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "[redacted]"
    password: "[redacted]"

captive_portal:

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

bluetooth_proxy:
  active: true


light:
  - platform: fastled_clockless
    chipset: WS2812B
    pin: 35
    num_leds: 1
    rgb_order: GRB
    id: status_led
    name: ${friendly_name} RGB LED
    effects:
      - random:
      - flicker:
      - addressable_rainbow:

binary_sensor:
  - platform: gpio
    pin:
      number: 41
      inverted: true
    name: ${friendly_name} Button
    on_press:
      then:
        - light.toggle: status_led

The relevant bit of the message that relates to the RGB LED:

In file included from .piolibdeps/atoms3-07/FastLED/FastLED.h:48,
                 from src/esphome/components/fastled_base/fastled_light.h:16,
                 from src/esphome.h:35,
                 from src/main.cpp:3:
.piolibdeps/atoms3-07/FastLED/fastpin.h: In instantiation of 'class FastPin<35>':
.piolibdeps/atoms3-07/FastLED/platforms/esp/32/clockless_rmt_esp32.h:178:23:   required from 'class ClocklessController<35, 60, 150, 90, (EOrder)66, 0, false, 5>'
.piolibdeps/atoms3-07/FastLED/chipsets.h:582:7:   required from 'class WS2812Controller800Khz<35, (EOrder)66>'
.piolibdeps/atoms3-07/FastLED/FastLED.h:105:52:   required from 'class WS2812B<35, (EOrder)66>'
src/esphome/components/fastled_base/fastled_light.h:150:41:   required from 'CLEDController& esphome::fastled_base::FastLEDLightOutput::add_leds(int) [with CHIPSET = WS2812B; unsigned char DATA_PIN = 35; EOrder RGB_ORDER = (EOrder)66]'
src/main.cpp:278:64:   required from here
.piolibdeps/atoms3-07/FastLED/fastpin.h:207:24: error: static assertion failed: Invalid pin specified
  static_assert(validpin(), "Invalid pin specified");

I’ve come to the conclusion that the AtomS3 Lite may not be supported yet or I am using the wrong board type.

1 Like

I have already pointed you to this page, but it recommends the idf framework for the S3

Try that.

Also if that is your complete log in the first part of your post, where does the last part with the error come from?

1 Like

Thanks, I’ll take a look at that page again.
The last part of my post is the output when I try to compile the yaml. It fails to compile and program due to an error with the assignment of gpio for the RGB LED.

Clearly something has compiled on it though, otherwise it wouldn’t be running in the first part of the log.

I can get it to compile, but only when I remove the sections that define the gpio pins.

Thought I would put in my vote of sorts here. Just so someone with the right skills knows others are interested.
I’m really looking forward to ESPHome working on the AtomS3. I am hoping the BT5 implementation on it will give better BT signal strength than the plane esp32 boards I have used so far. Hopefully closer to a Raspberry pi 4 with its bluetooth 5 experience.

2 Likes

I just got my s3 devices and was able to configure the bluetooth proxy and plug in illuminance sensor using this config. I haven’t tried to setup the light and onboard button yet. Hope this helps someone else along the way…

#M5 AtomS3
esphome:
  name: "esp-device-name"
  friendly_name: Device Room Name

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "y7lp0eZgbOp+M+PwPeFq3a17VLDVJNibjp/jn3Y4rVc="

# Over the Air Updates
ota:
  password: !secret ota_password

# Wifi Setup
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

# Bluetooth Proxy
esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms

bluetooth_proxy:
  active: true

# Illuminance Sensor
i2c:
  - id: bus_a
    sda: 2
    scl: 1
    scan: true

sensor:
  - platform: bh1750
    name: "${friendly_name} Illuminance"
    address: 0x23
    update_interval: 5s
4 Likes

I managed to get my AtomS3 devices working with Bluetooth proxy. All good so far. I would say that Bluetooth performance is not as good as some larger esp32 I’ve used. I occasionally see my temperature sensor data become ‘Unavailable’.

I managed to get the onboard button working.

I did quite a bit of investigation on the RGB LED and it seems that fasted is not supported for S3 yet.

1 Like

What other esp32 boards have you tried with better BT signal range?
Thanks.

The ESP32 DEV KIT DOIT or WEMOS D1 Mini boards seem to work a bit better with fewer dropouts.

Thank you for the code. Helped me get going instantly. Airthings Wave+ was detected seconds after the Atom came online. Truly amazing that it was that easy considering that M5stack doesn’t even mention that the AtomS3 Lite even has Bluetooth. Next, I would like to get the LED working if only to know the unit is on. Thinking that it would be nicefeedback to turn the LED Green from HA that way I would know that it is connected and the Airthings Wave+ is up and sitting out data. Thanks -Dave

I was able to get the Atom Lite working on ESPHome with this:

substitutions:
device_name: atomlitedemo
friendly_name: Atom Lite Demo
esphome:
name: ${device_name}
esp32:
board: m5stack-core-esp32
framework:
type: Arduino

Enable logging

logger:

Enable Home Assistant API

api:
encryption:
key: “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
ota:
password: “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

Enable fallback hotspot (captive portal) in case wifi connection fails

ap:
ssid: “Atomlitedemo Fallback Hotspot”
password: “xxxxxxxxxxxxxxxxxx”
captive_portal:

Device-specific

light:

  • platform: fastled_clockless
    chipset: WS2812B
    pin: 27
    num_leds: 1
    rgb_order: GRB
    id: status_led
    name: ${friendly_name} Light
    effects:
    • random:
    • flicker:
    • addressable_rainbow:
      binary_sensor:
  • platform: gpio
    pin:
    number: 39
    inverted: true
    name: ${friendly_name} Button
    on_press:
    then:
    - light. Toggle: status_led

Post your yaml properly please.

Here’s a working config for the M5Stack Atom S3 Lite

  • Working RGB Leds
  • Working IR Led
  • Working button
  • Working status LED
2 Likes

this post has been very helpful. I ended up with an M5AtomS3U with the usb A connection as that was all i could get in a reasonable amount of shipping time. After countless issues trying to flash any of the yaml code found here i ended up realizing that the web installer wouldnt see past the jtag programmer when using chrome or edge through a windows machine. I ended up having to plug the thing directly into my HAOS server. It worked to program it initially, but apparently it fails to update OTA. so eveytime i make a change i have to bring it back to the server for programming. anyone else had this issue with any of their m5 devices or is this unique to this specific product.

I am tring to use the Atom S3 Lite with a 4 channel relay. I have loaded the above code and that works well, but when trying to include a I2C portion to talk to the relay not allowing me to use GPIO 21 &22. Says GPIO22 is not valid.

Any ideas on how to use the grove Atom 4 channel relay?

Thanks!

I have the same problem. OTA Never Ever works on the Atom S3 Lite. Either timeout, stuck at 4% or 10%, bricks the device completely.

It does NOT reboot into safe mode. It’s totally bricked.

Only option is to plug the device into an USB port of a computer and do esphome run XXX.yaml with local (USB) upload.

It’s so frustrating :face_with_symbols_over_mouth:.

Has anyone been able to use a sensor connected to the groove connector? I have a temp sensor I would like to use.

I’m playing around with this at the moment. I want to use a GPIO port as an input for a thin film pressure sensor.

If I succeed, I’ll post the resultant yaml.

I have connected several m5stack sensors to the groove port with i2c
fonske/AtomS3_lite (github.com)