Emonpi sketch compilation

Hey guys,

I'm TOTALLY new to anything arduino... So i'm sorry for the probably stupid questions.

Anyway... I'm trying to compile the emonpi .ino sketch. I loaded all library's in the IDE but am getting a lot of errors shown below.

Anyway who wanna help ?

 

Arduino: 1.6.6 (Mac OS X), Board: "Arduino/Genuino Uno"

/Users/PatViv/Downloads/emonpi-master/Atmega328/emonPi_RFM69CW_RF12Demo_DiscreteSampling/emonPi_RF.ino: In function 'void handleInput(char)':
emonPi_RF:70: error: 'void handleInput(char)' was declared 'extern' and later 'static' [-fpermissive]
 static void handleInput (char c) {
                                ^
emonPi_RFM69CW_RF12Demo_DiscreteSampling:53: error: previous declaration of 'void handleInput(char)' [-fpermissive]
 #include <Wire.h>                                                     // Arduino I2C library
      ^
/Users/PatViv/Downloads/emonpi-master/Atmega328/emonPi_RFM69CW_RF12Demo_DiscreteSampling/emonPi_RF.ino: In function 'byte bandToFreq(byte)':
emonPi_RF:153: error: 'byte bandToFreq(byte)' was declared 'extern' and later 'static' [-fpermissive]
 static byte bandToFreq (byte band) {
                                  ^
emonPi_RFM69CW_RF12Demo_DiscreteSampling:54: error: previous declaration of 'byte bandToFreq(byte)' [-fpermissive]
 #include <LiquidCrystal_I2C.h>                                        // https://github.com/openenergymonitor/LiquidCrystal_I2C1602V1
      ^
/Users/PatViv/Downloads/emonpi-master/Atmega328/emonPi_RFM69CW_RF12Demo_DiscreteSampling/emonPi_Serial_LCD.ino: In function 'void showString(const char*)':
emonPi_Serial_LCD:109: error: 'void showString(const char*)' was declared 'extern' and later 'static' [-fpermissive]
 static void showString (PGM_P s) {
                                ^
emonPi_RFM69CW_RF12Demo_DiscreteSampling:58: error: previous declaration of 'void showString(const char*)' [-fpermissive]
 
      ^
exit status 1
'void handleInput(char)' was declared 'extern' and later 'static' [-fpermissive]

 

 

Robert Wall's picture

Re: Emonpi sketch compilation

I think your problem is "Arduino: 1.6.6"

As far as I'm aware, version 1.5 onwards of the compiler has different default settings and puts variables into different places, and that's what causes the errors that you see. The easiest solution for you is to remove that and load an older version of the Arduino IDE - possibly https://www.arduino.cc/en/Main/OldSoftwareReleases#1.0.x instead. I'm running Ubuntu Linux and use V1.0.5, which is still the recommended version for that OS.

But if you know enough C++, you can change the declarations to remove the errors. I have not checked, but there is bound to be more information about this on the Arduino forums.

Beire's picture

Re: Emonpi sketch compilation

Allright,

That was a simple fix, thx!

However when uploading with avrdude i'm getting following error:

avrdude-original: Using autoreset DTR on GPIO Pin 7
avrdude-original: stk500_getsync(): not in sync: resp=0x43

 

I'm using this command:

avrdude -v -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 38400 -U flash:w:emonPi_RFM69CW_RF12Demo_DiscreteSampling.cpp_CAL.hex

 

 

Beire's picture

Re: Emonpi sketch compilation

OK. Sorry.
Found my problem, searching the forums.
The command was right except for the baud rate.
Thx Robert. It was one of the (many) topics you helped out with...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.