ai assistant stopped answering in just 1 conversation. all other sketchs converations are fine. but in just the 1 it thinks and you see the 3 dots bounce but the nothing. i have restarted, and rebooted pc, tried other browsers but still no joy. any help would be gratefully received.
sorry i meant the Arduino AI assistant.
I moved your topic to an appropriate forum category @rcomfy.
In the future, when creating a topic please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.
Thanks in advance for your cooperation.
Thank you I am fairly new to this.
Hi @rcomfy. Is the problematic sketch an Arduino Cloud IoT Thing sketch, or is it a normal non-Thing sketch?
Hi its a cloud sketch
Please post your full sketch.
I'll provide instructions you can follow to do that:
- Open the sketch in Arduino Cloud Editor.
- Click on the window that contains your sketch code.
- Press the Ctrl+A keyboard shortcut (Command+A for macOS users).
This will select all the text. - Press the Ctrl+C keyboard shortcut (Command+C for macOS users).
This will copy the selected text to the clipboard. - Open a reply here on this forum topic by clicking the "Reply" button.
- Click the
<CODE/>icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
- Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the copied code into the code block. - Move the cursor outside of the code block markup before you add any additional text to your reply.
- Repeat the above process if your sketch has multiple tabs.
- Click the "Reply" button to publish the post.
#include <esp_now.h>
#include <WiFi.h>
#define DE_RE_PIN 4
#define TX_PIN 2
uint8_t allowedSenders[][6] = {{0xF8, 0xB3, 0xB7, 0x30, 0x40, 0x14}};
uint8_t dmxBuffer[513];
uint8_t lastChannels[4] = {0, 0, 0, 0}; // Track changes for channels 1-4
unsigned long lastReceivedTime = 0;
typedef struct {
uint8_t channels[20]; // DMX data from transmitter
} dmx_message;
void setup() {
Serial.begin(115200);
pinMode(DE_RE_PIN, OUTPUT);
digitalWrite(DE_RE_PIN, LOW);
dmxBuffer[0] = 0;
for (int i = 1; i < 513; i++) {
dmxBuffer[i] = 0;
}
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(1000); // Wait for WiFi to initialize
if (esp_now_init() == ESP_OK) {
esp_now_register_recv_cb(OnDataRecv);
Serial.println("ESP-NOW Ready");
Serial.println("Receiver MAC: " + WiFi.macAddress());
} else {
Serial.println("ESP-NOW Init Failed!");
}
Serial.println("DMX Receiver Ready - Waiting for ESP-NOW data...");
}
void loop() {
sendDMXFrame();
// Check for ESP-NOW timeout
if (lastReceivedTime > 0 && (millis() - lastReceivedTime) > 3000) {
Serial.println("NO ESP-NOW DATA for 3 seconds!");
lastReceivedTime = 0;
}
delay(200);
}
void OnDataRecv(const esp_now_recv_info* recv_info, const uint8_t *incomingData, int len) {
dmx_message msg;
memcpy(&msg, incomingData, sizeof(msg));
lastReceivedTime = millis();
Serial.println("*** ESP-NOW DATA RECEIVED! ***");
// Show first 4 channels
Serial.print("Received Ch1-4: ");
Serial.print(msg.channels[0]); Serial.print(" ");
Serial.print(msg.channels[1]); Serial.print(" ");
Serial.print(msg.channels[2]); Serial.print(" ");
Serial.println(msg.channels[3]);
// Copy received DMX channels to buffer and check for changes
bool hasChanges = false;
for (int i = 0; i < 4; i++) { // Only check first 4 channels
if (msg.channels[i] != lastChannels[i]) {
Serial.printf("Ch%d changed: %03d -> %03d\n", i+1, lastChannels[i], msg.channels[i]);
lastChannels[i] = msg.channels[i];
hasChanges = true;
}
}
// Copy all 20 channels to DMX buffer
for (int i = 0; i < 20; i++) {
dmxBuffer[i + 1] = msg.channels[i];
}
if (hasChanges) {
Serial.println("✓ DMX buffer updated!");
}
Serial.println("---");
}
void sendDMXFrame() {
digitalWrite(DE_RE_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TX_PIN, LOW);
delayMicroseconds(300);
digitalWrite(TX_PIN, HIGH);
delayMicroseconds(50);
Serial2.begin(250000, SERIAL_8N2, -1, TX_PIN);
Serial2.write(dmxBuffer, 513);
Serial2.flush();
Serial2.end();
digitalWrite(DE_RE_PIN, LOW);
delayMicroseconds(10);
}
#include <esp_now.h>
#include <WiFi.h>
#define RX_PIN 16 // DMX input pin
#define DE_RE_PIN 4 // Direction control (set LOW for receive)
uint8_t broadcastAddress[] = {0x34, 0x5F, 0x45, 0xE7, 0x64, 0xE8}; // Your receiver MAC
uint8_t dmxBuffer[513];
bool newDMXData = false;
typedef struct {
uint8_t channels[20];
} dmx_packet;
void setup() {
Serial.begin(115200);
pinMode(DE_RE_PIN, OUTPUT);
digitalWrite(DE_RE_PIN, LOW); // Receive mode
Serial2.begin(250000, SERIAL_8N2, RX_PIN, -1);
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(1000); // Wait for WiFi to initialize properly
Serial.println("Transmitter MAC: " + WiFi.macAddress());
// Verify MAC is valid
if (WiFi.macAddress() == "00:00:00:00:00:00") {
Serial.println("ERROR: Invalid MAC!");
}
if (esp_now_init() == ESP_OK) {
Serial.println("ESP-NOW Init Success");
esp_now_peer_info_t peerInfo;
memcpy(peerInfo.peer_addr, broadcastAddress, 6);
peerInfo.channel = 0;
peerInfo.ifidx = WIFI_IF_STA;
peerInfo.encrypt = false;
if (esp_now_add_peer(&peerInfo) == ESP_OK) {
Serial.println("Peer Added");
}
}
Serial.println("DMX Pass-Through Ready - Waiting for DMX data on pin 16...");
}
void loop() {
readDMXData();
if (newDMXData) {
sendDMXOverESPNOW();
newDMXData = false;
}
delay(20);
}
void readDMXData() {
static bool inBreak = false;
static int dmxIndex = 0;
static unsigned long lastDataTime = 0;
while (Serial2.available()) {
uint8_t data = Serial2.read();
lastDataTime = millis();
Serial.print("DMX Byte: ");
Serial.print(data);
Serial.print(" Index: ");
Serial.println(dmxIndex);
if (data == 0 && !inBreak) {
inBreak = true;
dmxIndex = 0;
Serial.println("*** DMX BREAK DETECTED ***");
continue;
}
if (inBreak && dmxIndex < 513) {
dmxBuffer[dmxIndex] = data;
dmxIndex++;
if (dmxIndex >= 21) {
newDMXData = true;
inBreak = false;
Serial.print("DMX Frame Complete - Ch1-4: ");
Serial.print(dmxBuffer[1]); Serial.print(" ");
Serial.print(dmxBuffer[2]); Serial.print(" ");
Serial.print(dmxBuffer[3]); Serial.print(" ");
Serial.println(dmxBuffer[4]);
}
}
}
// Check for DMX timeout
if (lastDataTime > 0 && (millis() - lastDataTime) > 2000) {
Serial.println("NO DMX DATA for 2 seconds - Check connections!");
lastDataTime = 0;
}
}
void sendDMXOverESPNOW() {
dmx_packet packet;
for (int i = 0; i < 20; i++) {
packet.channels[i] = dmxBuffer[i + 1];
}
esp_err_t result = esp_now_send(broadcastAddress, (uint8_t*)&packet, sizeof(packet));
if (result == ESP_OK) {
Serial.println("✓ DMX data sent via ESP-NOW");
} else {
Serial.print("✗ ESP-NOW send failed: ");
Serial.println(result);
}
}
They are my transmitter and receiver codes for a wireless dmx to go from the output of dmx signal for my pc to the lights without using a router. I am not sure if it is just a case of running out of free conversation with the Ai Assistant as I am on the free agreement etc
i am almost there with it as i can connect with the lights and a a point was able to sent data from the trans to the receiver. and it seems to connect and receive to the pc dmx lead but will not receive the data in the trans serial when i change dmx values in the pc software. i know the dmx signal works as i plug the lead to the lights direct they respond how thy should and change when i change the values etc
Cool project!
Are you experiencing the problem with the Arduino AI Assistant when either of these sketches are open in Cloud Editor, or only when one of the two sketches is open?
It is a good hypothesis. Please click the following link to open the "Plan Usage" page in your web browser:
https://app.arduino.cc/plan-usage
Check the usage value on the "Editor AI assistant" line of the page. Does it show that you have used up the entire allowance of interactions provided by your Arduino Cloud plan?
Hi thanks for that it is at the max Number of AI-assisted interactions available per month! do you know when they refresh is it at the start of a new month ie tomorrow or from when you first started using it?
