ttlappalainen / NMEA2000

NMEA2000 library for Arduino
542 stars 229 forks source link

cstdint: No such file or directory #include <cstdint> #391

Open zeidda opened 9 months ago

zeidda commented 9 months ago

Hello, I am working on a project to using CANBed - Arduino CAN-BUS Development Kit (ATmega32U4 with MCP2515 and MCP2551) to read data from CAN BUS such as RPM and depend on that I want to give commands to my trim relays, I am have issue with my code when I run it, it shows this error cstdint: No such file or directory #include can someone please help ?

ttlappalainen commented 9 months ago

cstdint is included in RingBuffer.h. You can change it to #include . Seems that cstdint is not supported by AVR. On the other hand stdint.h is deprecated so have to think a bit best solution.

zeidda commented 9 months ago

Hello, thank you for replying. I think am having a problem with libraries to be included in my code, am using CANBed Kit as I mentioned, am trying to read RPM codes through serial monitor maybe, I need help in what libraries I can include to make this happen and maybe I can share my code to see what am missing.

ttlappalainen commented 9 months ago

I prefer to forget that board: ● Flash memory: 32 KB ● SRAM: 2.5 KB

See library requirements https://ttlappalainen.github.io/NMEA2000/page_h_w_set_up.html#secTRecHW I have wrote that "So you should have at least 8 kB RAM in your processor"

Go to ESP32 or Teensy 4.x

zeidda commented 9 months ago

Thank you, Timo, I will order the ESP32, do you recommend can transceiver that work better for this board and, is there a link that can show me how the connection will be from the esp32 to CAN transceiver to NMEA 2000? And back to my main project there should no problem for me to read data and sending commands to relays using this library and this board?

ttlappalainen commented 9 months ago

Read the document! Under https://ttlappalainen.github.io/NMEA2000/page_h_w_set_up.html there is description about transceivers and wheather you can use unisolated or must use isolated. Do not mix CAN transceiver and CAN controller. ESP32 has build in CAN controller and you need on transceiver.

With ESP32 one can do that and lot more.

zeidda commented 8 months ago

Hello Timo, I have received the NANO Arduino ESP32 today, I tried to run the data display 2 but am having compilation errors, I need help tracking down these errors please! I included two libraries NMEA2000master.zip and ESP32master.zip, I also uncommented the defines lines that work with esp32, and I also included the NMEA2000_esp32 library to the DataDisplay2.

Is this the process to compile the code into the Arduino Nano ESP32? Is there anything that I am missing?

Capture
jiauka commented 8 months ago

Arduino nano has the ESP32-S3 chip, you need this library https://github.com/jiauka/NMEA2000_esp32xx

Instead of the NMEA2000_esp32

zeidda commented 8 months ago

okay thank you I got the code uploaded with no error. now how can i see data? Do I need another software so be able to read data? Or will it show up on Arduino IDE serial monitor? Baud rate need to be changed?

jiauka commented 8 months ago

Check ActisenseListener example, everything you ask is there.

zeidda commented 8 months ago

Thank you for your quick reply, I tried to run the ActisenseListener example, and I am not able to read any data coming from NMEA2000 network, when I open NMEA2000 reader there os no data showing, below is my current connection diagram for esp32, iso1050, and the DB-9 connector, do you believe I have a connection issue? also, I noticed that I cant enable any option on NMEA2000 reader for TX and RX

Capture
jiauka commented 8 months ago

Connect the gnd of the 5V to the nmea2000 it won't harm.

Also be sure that TX and RX at the EsP32 are properly configured as TWAI Rx & tx

zeidda commented 8 months ago

Thank you I found the error. using data display2 I was able to read data from NMEA2000 network.

although, when using actisense reader example i get undecrypted data as shown on the serial monitor picture below, do you know what can be causing this issue?

Capture

on actisense NMEA reader I don't see any data and I cant enable tx and rx PGNs

Captureq
ttlappalainen commented 8 months ago

You are mixing things a bit.