DudeYarvie / JARViE_Home_Automation_Modem

Hardware resources and Arduino library for JARVIE Power Line Home Automation Modem
30 stars 10 forks source link

Arduino IDE Compile Error: "invalid conversion from 'char*' to 'uint8_t*" #5

Closed Intechgreater closed 1 year ago

Intechgreater commented 1 year ago

As shown in the attached screenshot, getting the compile error "invalid conversion from 'char' to 'uint8_t" on line 49 in PLM_Shahara_Master_Transmit_1.0.ino: checksum = fletch_check(msg, strlen(msg));

Please advise

PLM_Shahara_Master_Transmit Compile Error Screenshot 2023-03-25 231102

DudeYarvie commented 1 year ago

OK first, I believe you did this but just to start with low hanging fruit, did you copy the following files from the Firmware/src/Shahara/Libraries directory to your Arduino sketch folder?

Capture

Intechgreater commented 1 year ago

Appreciate the rapid response! Yes, the entire firmware directory was copied to the Arduino sketch folder. Got it to work by typecasting the msg variable: checksum = fletch_check((uint8_t*)msg, strlen(msg));

DudeYarvie commented 1 year ago

FYI, when I compile the code with Arduino 1.8.13, it compiles successfully.
Capture

I believe you could also update fletch_check to pass in a char *data instead of _uint8t *data by updating the function to, uint16_t fletch_check( char *data, int count ); This change would need to be done in the .ino, PLM.cpp and PLM.h.

Intechgreater commented 1 year ago

Replacing uint8_t *data with char *data in the .ino, PLM.cpp and PLM.h did compile in 1.8.16 and run. Thanks! Another hurdle was finding the correct board core & fuse settings for the actual chip model on my demo boards - a regular ATmega328 as opposed to the ATmega328P in the docs. Exciting to at least get the boards modified for the application and onboard blue LED blinking so far!

DudeYarvie commented 1 year ago

I think you're bringing up some good questions/topics. For the record, I believe the only difference between the ATmega328 and ATmega328p is the "p" denotes the lower power option. I would think the fuse settings for both silicon are the same but I could be wrong. I used the fuse settings in the repo to program both the regular and p versions and seen no issues.
If you have seen issues or seen that different fuse settings are required, please share your findings. Feel free to open a new issue stating that ATmega328p fuse settings provided in the repo don't work for the Atmega328.(https://github.com/DudeYarvie/JARViE_Home_Automation_Modem/tree/master/Firmware/src/Shahara)/Shahara_ATmega328p_MCU_FUSE_Settings.txt