Pages: [1]   Go Down
Author Topic: Arduino DUE <-> Android App "Arduino Manager"  (Read 1310 times)
0 Members and 1 Guest are viewing this topic.
Munich
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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

* IOSControllerWiFi.h (6.14 KB - downloaded 18 times.)
* IOSControllerWiFi.cpp (23.02 KB - downloaded 29 times.)
« Last Edit: January 26, 2014, 07:41:17 am by RPieter » Logged

Let's make it !

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12190
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Due doesn't have any EEPROM.
Logged

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

Munich
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Let's make it !

Munich
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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?

* IOSControllerWiFi_PiR.cpp (24.27 KB - downloaded 15 times.)
* IOSControllerWiFi_PiR.h (6.39 KB - downloaded 13 times.)
* TestArduinoManagerWiFi_1_10_PiR.ino (7.41 KB - downloaded 14 times.)
Logged

Let's make it !

0
Offline Offline
Shannon Member
****
Karma: 207
Posts: 12190
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

Munich
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley
Logged

Let's make it !

Pages: [1]   Go Up
Jump to: