I’m trying step by step to implement a fram memory module to esphome.
to do so, i’m trying to setup a custom component, to start with, no fany stuff, just setup and loop.
one thing i don’t understand, why is the log output from the setup not visible in esphome.
The log output from the loop is visible.
is it becaus the chip isn’t ready for displaying anything, how can i manage to display these kind off stuf.
Later on in the setup the fram chip is setuped, so i wan’t to display a message that a memory module is found and is ready for use.
This is what i have so far, not much but try to understand why things are going as they go.
My i2cfram.h file
/**************************************************************************/
/*!
@file I2CFram.h
@author AGE
@section HISTORY
v0.1 - fIRST TEST RUN
iNTERFACE for the MB85RC I2C FRAM from Fujitsu.
@section LICENSE
Software License Agreement (BSD License)
*/
/**************************************************************************/
#include "esphome.h"
class MyFram : public Component
{
public:
void setup() override
{
ESP_LOGI("custom", "Setting up myI2CFram");
}
void loop() override
{
ESP_LOGI("custom", "Running ...");
}
};
my esphome file
esphome:
name: 102-fram
includes: i2cfram/i2cfram.h
esp8266:
board: d1_mini
# Enable logging
logger:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pwd
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "102-fram Fallback Hotspot"
password: !secret esphome_pwd
manual_ip:
static_ip: 192.168.1.102
gateway: 192.168.1.1
subnet: 255.255.255.0
# Enable Captive portal
captive_portal:
#enable ota
ota:
password: !secret esphome_ota
web_server:
port: 80
# Enable Home Assistant API
api:
password: !secret esphome_api
i2c:
- id: bus_a
sda: GPIO4
scl: GPIO5
scan: true
# restart button voor de s0tool
button:
- platform: restart
name: "Restart device"
custom_component:
- lambda: |-
auto my_fram = new MyFram();
App.register_component(my_fram);
return {my_fram};
components:
- id: my_fram_id