Go Down

Topic: Arduino DUE <-> Android App "Arduino Manager" (Read 1 time) previous topic - next topic

RPieter

Jan 26, 2014, 11:22 am Last Edit: Jan 26, 2014, 01:41 pm by RPieter Reason: 1
Hey guys,

Yesterday I downloaded the Android App "Arduino Manager" (https://sites.google.com/site/lurvill/arduinomanager_1-6).

I have an Arduino WiFi Shield to connect the Arduino board with my Smartphone.

I tried it with my UNO, and after commenting out some code because the memory from the UNO was too small for the ArduinoManager-Library, it was working. But from the moment I connect my smartphone to the UNO the UNO is not running smoothly. I have put some counters in my code for debugging, and every second the UNO stops running for a short instance. The result from this is that the data I am sending to the App is not updating continuously.

Now the next step for me is to try this on my Arduino DUE, here also using the Arduino WiFi shield. After installing the shield on the DUE and trying to compile it I got the following error:

Quote
Arduino: 1.5.5-r2 ( Windows 8 ), Board: "Arduino Due (Programming Port)"

In file included from c:\program files (x86)\arduino\hardware\tools\g++_arm_none_eabi\bin\../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/stdlib.h:21,
                from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/Printable.h:23,
                from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/IPAddress.h:29,
                from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:11,
                from C:\Users\Pieter\Documents\Arduino\libraries\IOSControllerWiFi_PiR\/IOSControllerWiFi_PiR.h:33,
                from C:\Users\Pieter\Documents\Arduino\libraries\IOSControllerWiFi_PiR\IOSControllerWiFi_PiR.cpp:23:
c:\program files (x86)\arduino\hardware\tools\g++_arm_none_eabi\bin\../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/sys/reent.h:490: error: #if with no expression
C:\Users\Pieter\Documents\Arduino\libraries\IOSControllerWiFi_PiR\IOSControllerWiFi_PiR.cpp:24: fatal error: avr/eeprom.h: No such file or directory
compilation terminated.


In attachment you can find the library for the Arduino Manager. Can somebody help me crack the problem? What I saw is the following include:

Code: [Select]
#include <avr/eeprom.h>

I suppose this is an include which only works for the AVR Arduino boards? Is here an easy fix to transform this library for the DUE processor?

Thanks a lot.

Pieter
Let's make it !

MarkT

[ I won't respond to messages, use the forum please ]

RPieter

Ok, so this library should be transformed so it stores in Flash, rather than tries to store in the EEPROM which is not there  :smiley-red:


Due doesn't have any EEPROM.
Let's make it !

RPieter

Here an update trying to port the library from this App so it is compatible with the DUE:

Ok, so the EEPROM which is not available on the DUE I fixed with commenting out everything which had to do with the "Alarm"-widget which is running on the App.

Next problem: it was using the functions "ltoa()" and "itoa()". Here I commented out everything what was using these functions. These functions are not ANSI C. I am not sure why the compiler from the UNO is able to use it, and the DUE's compiler isn't.

Next problem --> cli() and sei() functions were used. I changed this to noInterrupts() and interrupts() and the problem was gone. Is this the right thing to do?

Now I still have a final problem. I have been trying some things, but at the end I did not find a solution. The Arduino IDE gives me this message when I try to compile:
Code: [Select]
In file included from c:\program files (x86)\arduino\hardware\tools\g++_arm_none_eabi\bin\../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/stdlib.h:21,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/Printable.h:23,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\sam\cores\arduino/IPAddress.h:29,
                 from C:\Program Files (x86)\Arduino\libraries\WiFi\src/WiFi.h:11,
                 from C:\Users\Pieter\Documents\Arduino\libraries\IOSControllerWiFi_PiR\/IOSControllerWiFi_PiR.h:33,
                 from C:\Users\Pieter\Documents\Arduino\libraries\IOSControllerWiFi_PiR\IOSControllerWiFi_PiR.cpp:23:
c:\program files (x86)\arduino\hardware\tools\g++_arm_none_eabi\bin\../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/sys/reent.h:490: error: #if with no expression

--> IOSControllerWiFi_PiR.cpp / .h is the Library they provide together with the demo sketch. It seems like it is tracking a problem down to Printable.h, or stdlib.h ,... but here I cannot change anything. I also do not see what I could change there to solve the problem. Also in the file reent.h I do not know what to do.

I have put the "almost" DUE compatible library in attachment together with the sketch i am using. Note that this is the library which works together with the WiFi shield from Arduino.

Who can help me out?
Let's make it !

MarkT


Ok, so this library should be transformed so it stores in Flash, rather than tries to store in the EEPROM which is not there  :smiley-red:


Due doesn't have any EEPROM.


No dice, the only way to write the flash on the Due is to erase it all first.
[ I won't respond to messages, use the forum please ]

RPieter



Ok, so this library should be transformed so it stores in Flash, rather than tries to store in the EEPROM which is not there  :smiley-red:


Due doesn't have any EEPROM.


No dice, the only way to write the flash on the Due is to erase it all first.


Hello MarkT,

Ok, good to know this, so on the DUE there is no possibility to store something to memory so when you restart the DUE can start with saved values?

Anyway, in my last attempt to get my sketch+libraries working (as described above), I took everything out what has to do with saving things to EEPROM. I didn't try to transform it to storing to FLASH. The App will still work without this, it only loses one or two of it's widgets,...

Anyone an idea what this compile error could be which I described in my previous post up here?

Thank you  :)
Let's make it !

Go Up