Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAN_init shopuld be public #432

Open
cosina opened this issue Oct 7, 2024 · 3 comments
Open

CAN_init shopuld be public #432

cosina opened this issue Oct 7, 2024 · 3 comments

Comments

@cosina
Copy link

cosina commented Oct 7, 2024

Then the application can call CAN_Ini if, for whatever reason, communication can not be established upon starting EPS32. In my case ESP32 is tarted before power to NMEA was provided.

  if ( updReinit.Update( 50000 ) ) {  // not to often
    unsigned int bus_status = MODULE_CAN->SR.B.BS;
    if ( bus_status == 1) {
       // bus off - reinit
      NMEA2000.CAN_init();
      TRACE( "Reinit bus" ); 
    }
  }
@ttlappalainen
Copy link
Owner

No. That should be handled on higher level on tNMEA2000, since also it has to be restarted. I have that on my version, but have not published it.

@phatpaul
Copy link
Contributor

phatpaul commented Oct 18, 2024

My driver is detecting when the CAN bus is down and then back up again. It is successful in doing the bus recovery, but the library doesn't work after that without a restart.
https://github.com/phatpaul/NMEA2000_esp32xx/blob/b9a5c5e3ad5994b5cd3c55e160c9d8cd65bbbd7e/NMEA2000_esp32xx.cpp#L290

Couldn't the higher level library make use of this info to restart and redo the address claim etc? So i.e. hot-plugging the bus doesn't work without adding my own application code? Please advise on how best to do this.

EDIT: I.e. can my application code just call NMEA2000.Open(); again? Or do I need to destruct and construct the object again?

@ttlappalainen
Copy link
Owner

Email me directly so I can send you some instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants