Closed jiauka closed 1 year ago
Yes please! I work with the esp32-s3.
If you post a branch, I'd be happy to test and verify on that platform.
If it compiles on PlatformIO Espressif 3.5, please send me zip with email. I'll run tests, gives first impression does it work or not.
I can't go to newer than Espressif 3.5 since after that ESP32 is slow like worm in AP mode.
Hi I do use esp-idf V5, I have never worked on platfomio :(. Anyway I send you a ZIP, it is a WIP and TX has NOT been tested.
BTw, to which email? mine is jiauka_..a.at.gmai...
Anyway, here is a git https://github.com/jiauka/NMEA2000_esp32xx
Why do you use tasks for transmit and receive? As far as I understand twai documentation, you can define rx and tx queue sizes for twai_general_config_t. Then you simply call if ( twai_receive(&rx_msg, 0)==ESP_OK ) ...; for receive and twai_transmit(&tx_msg, 0); for sending. With tasks you waste extra 10k of memory.
Well, as I told it is WIP, and I saw on original NMEA2000_ESP that is uses interrupts and a kind of weird queu handling, I decided to implement a couple of task (like in espresif example) for RX, TX.
Probably it is much better not to use them. I will work on it this weekend.
BTW, I have commit a new version, there was a lock at TX task :( It works at TX, at least at my desk with a temperatur monitor TX and a text Actisense RX
Original NMEA2000_ESP uses queues (not weird), since it read/writes directly CAN controller. Twai driver does that internally.
Ok, I will rewrite it. It was a kind of quick and dirty test in order to make it work :). Once I test it with a true B&G Network, I will remove those queues and tasks
Hi again:
Lib working at least with ESP32 and ESP32c3. It uses the twai espressif HAL, so it should work on every esp32xx device with CAN/TWAI hardware. Tested with a B&G network that has some ESP32 and STM32F103 NMEA2000 devices too, and a VOLVO PENTA engine gateway, almost useless in my sail boat :(.
https://github.com/jiauka/NMEA2000_esp32xx
An example using esp-idf is located at
Ome hints:
#if CORE_DEBUG_LEVEL >= ESP_LOG_DEBUG
static const char *const TAG = "TWAI_C3";
#endif
to avoid TAG totally
Thanks for the tips!
Done and tested on both esp32 and esp32c3 :) check git
git pushed right now
Hi, I made an NMEA2000 data viewer with an ESP32-2432S028 and arduino IDE. It works perfect!. Now I'n trying to port the code on a ESP32-4827S043 (bigger screen but ESP32S3.... I´m added and included the NMEA2000_esp32xx library to the arduino IDE, and select ESP32S3 developer module on IDE but don´t compiles... Should I do more changes to the code? Can you help me? compiling on a ESP32C2/C3 doesn´t work either.... Thanks in advance!!
It works fine with Arduino IDE and esp32c3.. I have done a quick and dirty hack at NMEA2000_CAN.h
`....
tNMEA2000 &NMEA2000=*(new tNMEA2000_esp32xx());
tNMEA2000 &NMEA2000=*(new tNMEA2000_esp32());
...
Or simply replacing
tNMEA2000 &NMEA2000=*(new tNMEA2000_esp32());
with
tNMEA2000 &NMEA2000=*(new tNMEA2000_esp32xx()); ` at NMEA2000_CAN.h should work with all esp32 variants In short, be sure to use the NMEA2000_esp32xx Library instead of NMEA2000_ESP32 For S3 should be similar. I only have esp32 and esp32c3, sorry Ir compiles fine with esp32S3, but I can not test it And maybe it is better to post any bug,issues,etc,.... at https://github.com/jiauka/NMEA2000_esp32xx ``
Compiles like a charm!! Thank you so much! Just had to add an * in the sentences after the "="
tNMEA2000 &NMEA2000=*(new tNMEA2000_esp32xx());
tNMEA2000 &NMEA2000=*(new tNMEA2000_esp32()); Thanks again. Next issues will go to https://github.com/jiauka/NMEA2000_esp32xx
Hi all! The not so new esp32c3 does no work with this library.
I have successfully implemented a new library that uses the native "twai" library from espresiff, so far it works with esp32c3 -at least receiving-. And I guess it should work with any "esp32" device (S2, etc..)
I need to do further test in order to triple check that it works fine on my boat.
The question
Is there any interest in such library?