ChipChop Support Forum
Log in
Log out
Join the forum
My Details
REPLIES: 16
VIEWS: 113
BACK
REPLY TO THIS POST
SteveElves
08 Dec 2024
Any way to incorporate messaging to a local MQTT broker as well?
I suspect that this is a stupid question, but since I have Home Assistant running, it would be nice to have the best of both worlds! Chip/Chop's coding & web/mobile apps are by far the best I've ever seen, but HA allows me to integrate and interoperate other existing devices, such as my Brultech GreenEye energy monitor, NuHeat smart thermostats (for in-floor heating), Z-Wave door locks, etc.
Gizmo
08 Dec 2024

It's on my list (very looooong list :-) to have a look at HA, the concepts are diametrically different ChipChop is all about remote control from anywhere in the world and for your own devices where HA is all about local "let's stay safe and never leave the house".
I will build a bridge at some point, no question about it.

Anywho, the short answer is...No & Yes :-) So bear with me and I'll try to explain.

The "No" answer

I don't allow any external ingress or outgoing malarkey from ChipChop servers, it's for your own safety.
That means communication from CC server to HA is not an option.

But...

ChipChop API servers can digest the mqtt protocol on a low TCP level and there is a non-documented ChipChop library vs. 1.5x using mqtt as a TCP data transport instead of http websockets that is already used by a some people here.

Why would this titbit of info be useful, well, there is another non-documented thingamajig that I've created (will be released soon) that I call the "ChipChop Hub" :-)
It's a mini bridge server that can run locally on a PI or whatever old banger of a PC/Mac/Linux box you may have and instead of connecting all your devices one by one to ChipChop you can connect them through local LAN, LORA, radio, smoke signals, bumble bees... to the hub and the hub will use a single WiFi channel to pass the data back & forth.

Here's a dirty video showing 100 devices connecting to the hub running on a PI Zero 2W and then to ChipChop. The PI even with 100 websocket connections was running under 5% CPU load and using only 75mb of RAM (that's the ChipChop Hub server and Linux together)
https://www.youtube.com/watch?v=K4e9Ev5KHLM

So, if I was to expand the Hub's brain to also use mqtt both as server & client simultaneously it should be absolutely doable to do mqtt from HA > CC Hub > CC server > CC App and reverse so you could to a degree have your HA devices controllable or at least observable from ChipChop

It would be a matter of experimenting what data format would HA be sending over mqtt and creating a translation layer to convert it to the ChipChop protocol but I've just been working on a commercial project doing exactly that with Shelly devices so I know exactly what is involved (I mean, literally working on it right now)

I don't have the time to install HA on a PI and see what shenanigans they've done to Linux but if it's just their server program running and Linux is not heavily modified then I guess you could have the Hub running on the same PI so no need for extra hardware.

So, what's the plan Steve man? Although this is loooowwww on my current priority list I don't mind doing some experiments

G
SteveElves
08 Dec 2024

"Plan"??! You said, "Plan"??! We don't have no stinking "Plan"!!!

I wish I knew what (if anything) was going on in this head of mine. But here's where I think I was going:

1. Home Assistant is fantastic because various members of the user ecosystem have come up with a ton of integrations to allow you to talk to all sorts of so-called "smart" devices, using a mishmash of methods. Great to be able to pull a bunch of readings and controls together into one place.

so far, so good...

2. Home Assistant is terrible because there is no real unifying direction or underlying vision for the UI. It's truly the Wild West out there. Sure, there are rules & protocols that have to be followed, but nothing is particularly simple or problem-free. It's not a fault - HA was never intended to be a "packaged solution". Unfortunately, that means that a whole lot of work is left to the individual user, and although the yaml code conventions are strictly enforced, not much else is.

Blynk applied a great deal of structure, but their business & pricing models are not aimed at hobbyists or home users.

Enter ChipChop. You've got a streamlined data communication engine in place - fast and reliable. Easily takes care of OTA updates and dynamic reprovisioning (near as I can tell). Nice mobile app appearance - uncluttered & user-friendly. Lets me make a bunch of my own IoT thingies that are useful to me, but not necessarily commercially-viable products. Who cares? Not me, I'm retired, and have no intention to go into business again. Anyone is free to take anything I build and run with it, no questions asked and no royalties required.

What's missing is an easy way to shove or receive data or commands from my own IoT gadgetry to/from the other devices that are currently attached to HA or my Universal Devices EISY. I have things like 8 NuHeat WiFi thermostats for my electric under-floor heat, and two Wiser Z-Wave door locks, and two different garden irrigation systems (one running on a Z-Wave microcontroller board called ZUno, and the other working on an Arduino Nano WiFi board). I have other silly things out there like rainwater tank level, house water pressure monitor, leak detectors, automatic water shutoff valves, etc.

Pretty much anything that I built will work fine in ChipChop. It appears I can send Actions from code in one device to other devices without difficulty. I can set alarm threshold values and create alerts. All good. It's when I want to do things with non home-built devices that I think I will have problems, and that's where the ability to interface with HA (possibly through MQTT, but whatever works!) might come in handy.

Obviously, this isn't a priority for any sane human being on the planet. But it's Christmas, so I figure I could at least put something on a list somewhere. Who knows, maybe Santa will read it this year!

SteveElves
08 Dec 2024

Here's the Arduino sketch running in a Lolin Wemos D1 Mini to monitor the pressure in my house water system, and set an alarm if the pressure drops too low (which may indicate a problem with the pressure pump or pressure switch):




```

/* ************************************************************************
Code to implement pressure tank monitor with OTA & MQTT
Sketch first implemented Jan. 29, 2024
************************************************************************* */

#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <ElegantOTA.h>
#include <AsyncMqttClient.h>
#include <ESP8266WiFi.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Ticker.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

// WiFi credentials
#define WIFI_SSID "<redacted>"
#define WIFI_PASSWORD "<redacted>"

float version = 1.4;
String alarm_state = "OFF";

String hostname = "Pressure Tank Monitor";

AsyncWebServer server(80);

// Raspberry Pi Mosquitto MQTT Broker
#define MQTT_HOST IPAddress(10, 0, 0, 198)
#define MQTT_PORT 1883

// Pressure Tank MQTT Topic
#define MQTT_PUB_WTRPRESS "esp/WeMosD1/water_pressure"
#define MQTT_PUB_PRESSLOWALM "esp/WeMosD1/alarm"

AsyncMqttClient mqttClient;
Ticker mqttReconnectTimer;

WiFiEventHandler wifiConnectHandler;
WiFiEventHandler wifiDisconnectHandler;
Ticker wifiReconnectTimer;

void connectToWifi() {
Serial.println("Connecting to Wi-Fi...");
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
}

void onWifiConnect(const WiFiEventStationModeGotIP& event) {
Serial.println("Connected to Wi-Fi.");
connectToMqtt();
}

void onWifiDisconnect(const WiFiEventStationModeDisconnected& event) {
Serial.println("Disconnected from Wi-Fi.");
mqttReconnectTimer.detach(); // ensure we don't reconnect to MQTT while reconnecting to Wi-Fi
wifiReconnectTimer.once(2, connectToWifi);
}

void connectToMqtt() {
Serial.println("Connecting to MQTT...");
mqttClient.connect();
}

void onMqttConnect(bool sessionPresent) {
Serial.println("Connected to MQTT.");
Serial.print("Session present: ");
Serial.println(sessionPresent);
}

void onMqttDisconnect(AsyncMqttClientDisconnectReason reason) {
Serial.println("Disconnected from MQTT.");

if (WiFi.isConnected()) {
mqttReconnectTimer.once(2, connectToMqtt);
}
}

void onMqttPublish(uint16_t packetId) {
Serial.print("Publish acknowledged.");
Serial.print(" packetId: ");
Serial.println(packetId);
}

// Input/output pins
const int analogPin = A0;
#define alarmLEDPin 14

// Pressure range (psi)
float pressure;
// const float pressure_comp_factor = 1.273; // Factor is linear; at gauge 70 psi it reads 55 psi, so factor = 70/55 (obs)
const float pressure_comp_factor = 1.20; // Factor is linear; at gauge 65 psi it reads 54 psi, so factor = 65/54
const float minPressure = 0;
const float maxPressure = 100;
const float offset = 5.95; // Zero offset factor - when disconnected, reading should be zero.

// Voltage range (VDC)
float voltage;
const float minVoltage = 0.306;
const float maxVoltage = 3.1;

// Other variables
int lowPressAlarmLimit = 10;
//int highPressAlarmLimit = 90;
bool lowAlarm = false;
//bool highAlarm = false;

// Provision for time delay on display & send to MQTT
unsigned long previousDisplayMillis = 0; // Stores last time pressure was displayed
const long displayInterval = 10000; // Interval at which to display & send pressure readings - default = 10 seconds

void setup() {
// Start serial communication
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);

// Set Pin mode
pinMode(alarmLEDPin, OUTPUT);

// Set analog reference voltage to default (3.3V)
analogReference(DEFAULT);

// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
Serial.println("SSD1306 allocation failed");
for (;;)
; // Don't proceed, loop forever
}

// Show initial display buffer contents on the screen -- Adafruit splash screen.
display.display();
delay(2000); // Pause for 2 seconds

// Clear the display buffer
display.clearDisplay();
// display.setTextColor(WHITE);

wifiConnectHandler = WiFi.onStationModeGotIP(onWifiConnect);
wifiDisconnectHandler = WiFi.onStationModeDisconnected(onWifiDisconnect);

mqttClient.onConnect(onMqttConnect);
mqttClient.onDisconnect(onMqttDisconnect);
//mqttClient.onSubscribe(onMqttSubscribe);
//mqttClient.onUnsubscribe(onMqttUnsubscribe);
mqttClient.onPublish(onMqttPublish);
mqttClient.setServer(MQTT_HOST, MQTT_PORT);

connectToWifi();

// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

/* Serial.println("");
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
Serial.print("IP address: "); //has been 10.0.0.51
Serial.println(WiFi.localIP()); */

server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
request->send(200, "text/plain", "Hi! I am WeMos D1 Mini MQTT Water Pressure sensor OTA HA Broker at 10.0.0.51 v1.4");
});

ElegantOTA.begin(&server); // Start ElegantOTA
server.begin();
Serial.println("HTTP server started");
}

void loop() {

unsigned long currentMillis = millis();
// Every displayInterval number of seconds (default = 10 seconds) it displays & sends a new set of values
if (currentMillis - previousDisplayMillis >= displayInterval) {
previousDisplayMillis = currentMillis; // Save the last time values were displayed
printValues();
}

ElegantOTA.loop();

}

void printValues() {

// Read voltage from analog input
voltage = analogRead(analogPin) * (3.1 / 1023.0);

// Scale voltage to pressure reading, apply compensation factor
pressure = (pressure_comp_factor * ((voltage - minVoltage) * (maxPressure - minPressure) / (maxVoltage - minVoltage) + minPressure) + offset);
#define constrain(pressure,minPressure,maxPressure)

// Check for low alarm state, set LED & alarm boolean
if (pressure < lowPressAlarmLimit) {
lowAlarm = true;
alarm_state = "LOW";
digitalWrite(alarmLEDPin, HIGH);
}
// else if (pressure >= lowPressAlarmLimit && pressure <= highPressAlarmLimit) {
else if (pressure >= lowPressAlarmLimit) {
lowAlarm = false;
alarm_state = "OFF";
digitalWrite(alarmLEDPin, LOW);
}

/* // Print pressure value to serial monitor
Serial.print("Pressure (psi): ");
Serial.println(pressure);
Serial.print("Voltage (VDC): ");
Serial.println(voltage);
Serial.print("Alarm State: ");
if (lowAlarm == false) {
Serial.println("NORMAL");
} else if (lowAlarm == true) {
Serial.println("ALARM");
} */

// Print to the OLED display
// Clear the buffer
display.clearDisplay();
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(SSD1306_WHITE); // Draw white text
display.setCursor(0, 0); // Start at top-left corner
display.print(F("Water Pressure: "));
display.setTextSize(2);
display.setCursor(0, 9);
display.print(pressure);
display.print(" ");
if (lowAlarm == false) {
display.print(F("psi"));
}
if (lowAlarm == true) {
display.print("Alarm");
}
display.display();

// Publish an MQTT message on topic esp/WeMosD1/water_pressure
// MQTT_PUB_WTRPRESS "esp/WeMosD1/water_pressure"
uint16_t packetIdPub1 = mqttClient.publish(MQTT_PUB_WTRPRESS, 1, true, String(pressure).c_str());
Serial.printf("Publishing on topic %s at QoS 1, packetId: %i ", MQTT_PUB_WTRPRESS, packetIdPub1);
Serial.printf("Message: %.2f \n", pressure);

// Publish an MQTT message on topic esp/WeMosD1/alarm
// MQTT_PUB_PRESSLOWALM "esp/WeMosD1/alarm"
uint16_t packetIdPub2 = mqttClient.publish(MQTT_PUB_PRESSLOWALM, 1, true, String(alarm_state).c_str());
Serial.printf("Publishing on topic %s at QoS 1, packetId %i: ", MQTT_PUB_PRESSLOWALM, packetIdPub2);
Serial.printf("Message: %.0f \n", alarm_state);

}

```




I don't think I would have any problem implementing this in ChipChop, but I want to be able to turn off the Z-Wave controlled HotWater tank relay and Pressure Pump relay, each of which are commercial products made by (I think) General Electric. That's where I think that MQTT integration comes in handy.
Gizmo
09 Dec 2024

That the spirit my dear Batman without a plan!!! I can work with that ;-)

Yeah, ChipChop is primarily focused on "self-builds", hell, the platform motto is Make dumb things smart and smart things smarter (chop it and chip it)

The one thing that ChipChop has as a bridge with "foreign" devices is Alexa and that works ok (within Alexa's limitations). As I said, I have HA in my sights and I bet you I will probably end up getting HA (PI, Linux and all) to work as a single "component" controllable through ChipChop ;0)

Ok, I had a quick look at your code and I think I have almost enough info to make a little test (kudos for using D1 minis, my absolute favourites for years, I've only recently started switching to ESP32-C3 supermini )

I have few questions for you, see if you can fill in the blanks

So, If I understand correctly, the D1 mini is monitoring the water pressure and sending that via mqtt to HA and then you have some logic rule in HA that if the pressure is too high/low sends a command to Z-wave relays.

- What is the http server on the D1 for? Is that for the OTA and nothing else?

- in printValues() at the end the line: uint16_t packetIdPub1 = mqttClient.publish(MQTT_PUB_WTRPRESS, 1, true, String(pressure).c_str());    
From your comment I figure that "1" is the QoS 1 level just need to know what is "true" for

- I think I should be able to modify your code so you can
    1. see the D1 readings in ChipChop
    2. see any time it fires the on/off or alarm
    2. keep doing what it's doing with HA
    3. manually trigger the z-waves on/off i.e. ChipChop > D1 > HA > z-wave
    4. adjust/change "on-the-fly" the D1 variables for example the alarm threshold min/max etc
    5. send you notifications on alarms (that's a given anyway through ChipChop Actions)

- What I can't do at the moment would be to also see the z-wave states on ChipChop
    for that you'd have to have a look in HA if you can send the z-waves state somewhere maybe on some time interval, probably the easiest thing would be to use the actual D1 to receive the state using that http server that is running anyway and the D1 can pass it to ChipChop so technically your D1 & z-wave relays would look and behave as one single device
    integrating z-wave properly into ChipChop like HA is doing is not a massive deal, it's just a matter of using a z-wave whatever they are called "bridge chip" or something and connecting it to an ESP over TX/RX and implementing the communication protocol (the ESP32-C6 has a builtin chip & radio for Zigbee but sadly not for z-wave)


What do you think?

G


p.s. Don't worry Santa will read your wish list, with that surname of yours it's a guarantee 🤣 (in my case, I'm f***d )


            
SteveElves
09 Dec 2024

Thanks for having a look at this - your ideas are awesome! I'm away from home today - we live on a small island near Vancouver, BC, and I go into the city every week or so to stock up on groceries, etc. I'll reply tonight or tomorrow.
Gizmo
09 Dec 2024

You are in bloody Vancouver CA!?? Yeah, you definitely need to check the ole' astigmatism as you've selected in the registration form "Server Zone" UK/EU so that's where I've located your account! 🧐

You must be waiting 300-400 milliseconds every time you press a button for something to happen!

Ah, well, I'll have to move you to the US server as it's a mere 7000 miles closer to you and doesn't involve data packets scuba diving under the Atlantic. Your UUID will change so you'll just have to re-compile stuff onto the esps.

Won't do anything now , no rush, I'm elbows deep in code today

Have fun in town
SteveElves
10 Dec 2024

To your questions:

1. You provide an accurate description of the desired operation. The D1 Mini reads the pressure in my home water system via a pressure transducer tapped in at the bottom of my pressure tank. The tank itself is an upright steel cylinder, approximately 40 cm in diameter and 90 cm tall. Internally (about 2/3 of the way up) it has a vaguely-hemispherical flexible diaphragm; there is air above the diaphragm (sealed off from the atmosphere); water enters & exits from the bottom of the tank (ie. there is fluid below the diaphragm). There is a very simple mechanical pressure switch attached to the water pipe at the bottom of the tank. Water is pumped from our well into a 2,500 Liter underground holding tank; a pressure pump in the bottom of the holding tank is switched on when this pressure switch detects a low pressure (about 50 psi). This pushes water into the bottom of the pressure tank, forcing the diaphragm up and compressing the air above it. When the pressure switch senses the upper pressure setpoint of about 74 psi, it turns the pressure pump off. The compressed air above the diaphragm is what forces water out of the bottom of the pressure tank into the house plumbing whenever someone opens a tap or flushes a toilet. This means that the pressure at our taps varies between 50 and 75 psi.

The pressure sensor attached to the D1 Mini is entirely separate from the pressure switch that operates the pump. The pump draws as much as 25 Amps @ 240 VAC, and has run happily on this entirely-mechanical system for years - I had no desire to mess with that.

2. I pretty much copied swaths of the code from "reliable sources" - hence the "http server" you found. I believe you are correct - that is there for the OTA functionality only, as far as I know. I don't think it's used for the MQTT functionality at all.

3. The "1" in the printValues statement is indeed the QoS, while the "true" is a boolean that tells the broker to retain the value, I think. I used an example from Random Nerd Tutorials for the MQTT part of the code.

4. I think the code modifications I would like are everything you suggested except #3. I think it would work better to keep the logic and resultant actions in HA because it isn't just low pressure that would trigger some remedial or protective actions. I want to be able to isolate parts of my plumbing system (like the hot water tank) in the event of a leak detected in that room, while I would perhaps want different actions based on another set of circumstances.

5. For now I don't think I need to see Z-Wave device states in ChipChop via this D1 Mini. It's performing a useful service right now and I am loath to mess with it. I think I would rather create a new ESP32 or ESP8266 device dedicated to passing Z-Wave relay states and relay commands. I think I can get HA to send a whole list of Z-Wave values via my MQTT broker without too much trouble. What do you think of that approach?
SteveElves
10 Dec 2024

Sorry about missing the location marker. I just got back from a holiday in Croatia and London, so at least part of my brain must still be "across the pond". No rush to fix - I built the "Smart LED" project and I was blown away at how fast it worked! Blynk takes a lot longer...
Gizmo
10 Dec 2024

Done!

Was a tad more painful than expected, had to do some re-plumbing of the ChipChop lib vs. 1.5x and the mqtt client code but now my friend you have a D1 communicating simultaneously with ChipChop and HA ;-)

I was a bit concerned that the D1 would not have enough juice as the secure ssl/tls encryption with ChipChop eats up the ram like a free buffet but my little D1 mini is happily running everything and still has 5-6kb of ram to spare (could fit 3x Arduino Nano's in that space).

I've also loaded the whole caboodle of latest plugins so you also have:

- WiFi Portal - handles wifi and ssid can be re-programmed from a phone if you change the device location
- KeepAlive - watches the connectivity in general and can restart the wifi or the entire esp automatically
- Prefs Manager - saves & loads variables in the flash so things can be re-programmed on the fly (I've made a small example so you can change on-the-fly the lowPressAlarmLimit & highPressAlarmLimit straight from the app or Dev Console)
- AutoPin - automatic digital pin control (just a simple example control of the D1 led but can do a lot more)
- OTA
- Timers - does a setInterval() and setTimeout() so no need to mess with millis() in the loop

I've used a little oled library I've been using for years instead of yours, was a bit quicker. Didn't have the time to test on a screen but should show icons & psi and also the date/time and connection signal with ChipChop.
If you don't like it or it doesn't work you can just switch to the one you've used.

Note: I've tested all this through my personal mqtt server, it's not a baseline "broker" but a low level stuff so I can see the data packets and they look correctly formed so I would assume it should work with whatever HA is using, probably Mosquito?
If it doesn't work and HA complains I'd have to probably tweak few parameters and try again, it can only be the QoS or Dup or some crap like that.

Instructions

1. First create a new device in the Dev Console:

    name: Pressure Tank Monitor
    Device ID: pressure_tank_monitor (<<< exactly like this)

Components:

    alarm
        type: Custom Button > Pressed Value "LOW", Released value "OFF" (see screenshot, use whatever icons you fancy)
        mode: view only

    pressure
        type: numeric value
        mode: view only

    low_pressure_alarm
        type: numeric value
        mode: Interactive

    high_pressure_alarm
        type: numeric value
        mode: Interactive

    ota
        type: text value
        mode: Interactive




The low_pressure_alarm & high_pressure_alarm can be used to dynamically change the variables directly from ChipChop so make sure they are set as mode: Interactive



2.

Download this: https://chipchop.io/various/steve_e/Pressure_Monitor.zip

Unzip and copy into Arduino IDE and then edit the main ino file.
You need to add the missing bits of info:

    - ip
    - auth-code
    - wifi ssid & pass

Compile and hopefully there will be no errors and take whatever precautions you need before you push this onto the D1 fully ...can you do a dry-run test with a different D1 and a dummy device in HA?


Let me know how it goes

G









Attached images
SteveElves
12 Dec 2024

Wow - that looks fantastic! Give me a few days to poke away at it and I'll let you know.
If this works, it'll be a game changer for more than just me, I think!

As an aside, I really like the little D1 Minis as well - the form factor is cool, they mount nicely on project boards, lots of memory and reasonably speedy. They seem to be reasonably durable, too! If I had any complaints it would be the lack of additional I/O pins - but to be fair I've only had one project where that was an annoyance. I've done some projects with Feather Huzzahs and they are kinda I/O-crippled as well, so there you go.

Thanks a whole bunch for the effort you put into this - it's really cool! Do you have a Patreon or other similar account that I can help support you by?
Gizmo
12 Dec 2024

Great stuff!

Yeah, I've been using D1 minis for years but I had a couple going funny on me after some years of service (just about to replace another one doing my electricity meter) and I've officially switched this year to ESP32-C3 supermini and I can whole heartedly recommend them.

I think Espressif have intended for the C3 to become a replacement for ESP8266 so the question is how long they will be manufacturing the 8266. This is what they look like: https://www.amazon.ca/Waveshare-Development-Frequency-ESP32-C3FN4-Single-Core/dp/B0CRB1QMX2/

If this concept works with HA/ChipChop then I think it may be even possible to use an ESP32 like the C3 to act as a bridge for 5-6 devices simultaneously (maybe even more) it's just down to the available RAM

Thank you so much for your kind words it means a lot! I have been asked many times about Patreon but I don't know if that would be the right thing to do, I have something much nicer in mind that I may have to pick your brains about :-)

Keep me posted how it goes and don't rush!

Now, back to my salt mine, I'm seriously conceptually stuck with the redesign of the ChipChop app it's driving me crazy

tc

G
Down Under
12 Dec 2024

@G

does this mean that the CC lib 1.5x is officially out? can I start flashing everything, seems rock solid/fast, not a hiccup so far.
SteveElves
13 Dec 2024

OK, you sold me - I've ordered 3 of the Waveshare boards from Amazon. Should be here by the end of the month. I'll let you know when I start playing with them!

btw - happy to brainstorm with you about various support options anytime. We can converse over email if you'd prefer.
Gizmo
13 Dec 2024

@DownUnder

Yes and no 🫣

Yes, the 1.5x using mqtt as data transport is fully integrated on all API servers and it's there to stay same as WebSockets as it adds another layer of compatibility for various devices.

But...I would hold on for a couple of months as there will be vs. 2.0x with a completely new protocol😱 I've got fed up with limitations of both websockets and mqtt, they are both standards but also designed to be multifunctional so it's a mishmash of things.
The new protocol will be purely specialised for ChipChop IoT, so far I've got it down to a tenth of a size of websockets and about 3 times smaller than MQTT with at least 200% speed increase both on MCUs and the server side and it will open up a ton of new possibilities.

So, if you are making something new right now then by all means use the vs 1.5x that I've sent you for testing and once 2.0x is released you can decide if you want to upgrade. Btw, you won't have to change anything in your code, the 2.0x will be fully backward compatible.

Gizmo
13 Dec 2024

@SteveElves

Ah, you are now in trouble, the C3 are so small you will be getting extra creative. Just had to make a bunch of temperature sensors using the DS1820 probes (the ones on a long cable) and I've just soldered the connections directly to the C3 and shrink wrapped it and it looks like it's a part of the cable :-)

To preempt your potential frustration if you don't see any output in the serial monitor from your Serial.print() then you may have to add couple of compile extra flags for the C3. In my version of Arduino IDE I don't have to do anything but I've heard some people do, I use PlatformIO so I don't know exactly how you do it in Arduino IDE but if you get stuck let me know.
.
On PlatformIO the flags are:

-DARDUINO_USB_CDC_ON_BOOT=1
-DARDUINO_USB_MODE=1

I'll definitely drop you an email at some point with some ideas that I have, would be interesting to hear your opinions.

I have to urgently fly abroad on Sunday to sort some crap for a client so it will be later next week. Don't worry I will be 100% available if anyone needs me and probably bored senseless in the hotel in the evenings (done some of my most creative work on long haul flights and in hotel lobbies :-)

Keep me posted

G

SteveElves
14 Dec 2024

Happy travels! Christmas is going to start to get a bit nuts around here for the next couple of weeks in any case.
Got children and grandkids coming, have to plan meals and timeout spaces...

I remember having to travel at the last minute many times to keep clients happy. Once I was sent to the far north (Yukon) on January 1st to help startup a huge boiler in a steam plant in a pulp mill. Temperature was -55 C - I've never been so cold in my life! Retirement has some benefits - at least when I travel now, it's usually because my wife & I planned it ahead of time!

Keep in touch, and have fun!