Any general discussion around the firmware, what is does, how it does it etc.
By Matheus Abreu
#69653
Hey folks, I'm trying to get the VE table via Serial using another arduino, like if it was tuner studio, but I'm having a really hard time with building the requests and decoding the responses.

This is what I had the most success with but I don't have any idea if it's the right way as I based it only on reading the comms.cpp file. I can get the value of a single cell, but the value is not consistent in amount or order. Anyone has any experience with this and could give me a light?
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX


void setup() {
  mySerial.begin(115200);
  Serial.begin(115200); 
}

void read_p(byte getData[3])
{
  byte res[256];   
  mySerial.write(getData, 5);
  mySerial.read();          // First byte should be only an OK
  mySerial.readBytes(res, 256);
  Serial.print ("Cell: ");Serial.print(res[0]);Serial.println();
}

void loop() {
  byte sendSequence[] = {112, 0, 2, 256, 256}; // p, 0 (can_id), 2 (page), 0 (offset), 256 (length)
  read_p(sendSequence);
  delay(1000);
}
Sample output im getting:
Code: Select all
Cell: 34
Cell: 34
Cell: 1
Cell: 36
Cell: 36
Cell: 1
By dazq
#69654
I would suggest switching round your serial ports.
Read from speedy using the hardware serial port and then monitor the data using the software serial at a MUCH lower data rate.
Soft serial does not work well at 115200
Several have tried using it (myself included both during development of secondary serial itself and for gpio) and found it at best unreliable in this application.
Alternatively use a different MCU with multiple hardware serial ports such as a mega , teensy or stm32.
By Matheus Abreu
#69655
dazq wrote: Sat Sep 28, 2024 12:23 am I would suggest switching round your serial ports.
Read from speedy using the hardware serial port and then monitor the data using the software serial at a MUCH lower data rate.
Soft serial does not work well at 115200
Several have tried using it (myself included both during development of secondary serial itself and for gpio) and found it at best unreliable in this application.
Alternatively use a different MCU with multiple hardware serial ports such as a mega , teensy or stm32.
I changed to a Mega using the hardware serial and now I get always the same value, but still it doesn't make sense. Running the code in the original post I get always "Cell: 162". I probably need to convert the bytes value in some way I'm not aware.
By Alfagta
#69819
Matheus Abreu wrote: Sat Sep 28, 2024 12:54 am
dazq wrote: Sat Sep 28, 2024 12:23 am I would suggest switching round your serial ports.
Read from speedy using the hardware serial port and then monitor the data using the software serial at a MUCH lower data rate.
Soft serial does not work well at 115200
Several have tried using it (myself included both during development of secondary serial itself and for gpio) and found it at best unreliable in this application.
Alternatively use a different MCU with multiple hardware serial ports such as a mega , teensy or stm32.
I changed to a Mega using the hardware serial and now I get always the same value, but still it doesn't make sense. Running the code in the original post I get always "Cell: 162". I probably need to convert the bytes value in some way I'm not aware.
Your code makes no sense…
Have a closer look at read_p

... — is the ultimate goal to alter code t[…]

Project progressing. Have been addressing some wi[…]

Airbear Web Interface Development

Hey guys, I've started making my own user customi[…]

https://i.postimg.cc/T1FYgG9j/FbbXf-1.gif

Still can't find what you're looking for?