- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I'm using the eclipse Iot in Windows and I write a C++ code and try to upload it, it's working well but when I disconnect it everything was stopped.
So the question is how can I burn my code into the board? Thanks!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
You can execute your code following next steps:
- connect to your edison via ssh/serial
- cd /tmp/
- execute your file ./your_app_name
Regards¡
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thank you Fran.B
The second step is in Remote System Explorer and ssh terminals lauch? I'm a beginer to use eclipse .
I tried the terminals lauch and got the sentence below:
root@edison:~# cd/tmp
-sh: cd/tmp: No such file or directory
Is there some other things I have to do before?
(I'm not using Linux)Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
are you writting cd /tmp ??
If you cant try to write
cd .. (go to the upper folder)
cd .. (go to the upper folder)
ls list all the folder of the directory
and
cd tmp
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks.
But still the same issue, everything will stop after disconnect it or switch off it.
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello zhanghang,
This question is very similar to the one found in /message/358838# 358838 Re: C++ Creating Release Version, I'd suggest you to check it. It talks about how to create a system service which will make your script run on boot every time.
Let me know if it helps, or if you need help creating a service for your project.
Peter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks for your response Peter,
It's really similar with my problem and I'm trying to use your way but I have some issues:
root@edison:~# gcc graphicsTest.cpp -o graphicsTest -lmraa
graphicsTest.cpp:15:39: fatal error: Adafruit_GFX/Adafruit_GFX.h: No such file or directory
# include "Adafruit_GFX/Adafruit_GFX.h"
^
compilation terminated.
The above information is what I got by edison. I think the problem is that I was using some other libraries and maybe I have to create the library files?
How can I create the library files? To use the same way as "vi Adafruit_GFX.h"? And before create this file I have to create a directory names Adafruit_GFX in the same directory as my .cpp file ?
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Peter,
After I created all the libraries I need, I got the errors below:
root@edison:~# gcc graphicsTest.cpp -o graphicsTest -lmraa
In file included from Adafruit_ILI9341/Adafruit_ILI9341.h:12:0,
from graphicsTest.cpp:17:
/usr/include/mraa/gpio.h:40:1: error: expected initializer before 'extern'
extern "C" {
^
In file included from /usr/include/c++/4.9.1/new:40:0,
from /usr/include/c++/4.9.1/ext/new_allocator.h:33,
from /usr/include/c++/4.9.1/i586-poky-linux/bits/c++allocator.h:33,
from /usr/include/c++/4.9.1/bits/allocator.h:46,
from /usr/include/c++/4.9.1/string:41,
from /usr/include/mraa/common.hpp:29,
from /usr/include/mraa.hpp:27,
from graphicsTest.cpp:25:
/usr/include/c++/4.9.1/exception:35:37: error: expected declaration before end of line
# pragma GCC visibility push(default)
^
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Can you share your script and the libraries you installed? If the script compiles on Eclipse it should also compile on the Edison. Something that's correctly installed on Eclipse is probably missing on Edison. What did you add on Eclipse?
Peter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
The libraries I include:
# include "Adafruit_GFX/Adafruit_GFX.h"
# include "Adafruit_ILI9341/Adafruit_ILI9341.h"
# include "Adafruit_TFTLCD/Adafruit_TFTLCD.h"
# include
# include
# include
# include
# include
# include "mraa.hpp"
# include "grove.h"
# include
# include "math.h"
# include
The first three libraries can be find from here: https://github.com/llatta/edison-graphics/tree/master/src edison-graphics/src at master · llatta/edison-graphics · GitHub
Note that the file graphicsTest from this link is not the file I'm using.(I'm just using the same name)
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I just noticed that you were trying to compile C++ code with GCC, that might be one of the issues. GCC is used when compiling C code, if you would like to compile C++ code you will have to use G++. How to install G++ and compile with it is also mentioned in on my last reply.
Now, I believe I know how you can correctly compile your script, but will need git, in case you don't have it already, you can get it from AlexT's repo (you can find how to set it up also on ) with the command:
opkg install git.
Use git to download the library with the command:
git clone https://github.com/llatta/edison-graphics https://github.com/llatta/edison-graphics
Once downloaded go to /edison-graphics/src and store your script in there. Now compile it with the command:
g++ yourscript.cpp -o yourscriptoutput -lmraa
Let me know if it works.
Peter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks.
But still the same issues as I write before:
root@edison:~# g++ graphicsTest.cpp -o graphicsTest -lmraa
In file included from Adafruit_ILI9341/Adafruit_ILI9341.h:12:0,
from graphicsTest.cpp:17:
/usr/include/mraa/gpio.h:40:1: error: expected initializer before 'extern'
extern "C" {
^
In file included from /usr/include/c++/4.9.1/new:40:0,
from /usr/include/c++/4.9.1/ext/new_allocator.h:33,
from /usr/include/c++/4.9.1/i586-poky-linux/bits/c++allocator.h:33,
from /usr/include/c++/4.9.1/bits/allocator.h:46,
from /usr/include/c++/4.9.1/string:41,
from /usr/include/mraa/common.hpp:29,
from /usr/include/mraa.hpp:27,
from graphicsTest.cpp:25:
/usr/include/c++/4.9.1/exception:35:37: error: expected declaration before end of line
# pragma GCC visibility push(default)
^
I've already installed git and g++ with the board by the commands you told me.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Can you share your script? If you have downloaded the libraries and compiled the script in their directory there shouldn't be a problem, I would like to replicate this to see if I get the same behavior.
Peter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi zhanghang,
Have you been able to compile and run your code successfully?
Could you share your script and let us from where are you downloading the libraries?
Regarding MRAA, which version do you have?
Regards,
Charlie

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page