Community
cancel
Showing results for 
Search instead for 
Did you mean: 
IIstv
New Contributor I
1,758 Views

How to upgrade mraa in a Yocto image?

I have downloaded this Yocto image:

http://iotdk.intel.com/src/3.5/edison/iot-devkit-yp-poky-edison-20160606.zip http://iotdk.intel.com/src/3.5/edison/iot-devkit-yp-poky-edison-20160606.zip

Based on the edisonbsp_ug_331188007.pdf I have built the Edison root fs.

After the build I have flashed my Edison from the to Flash directory.

Next I built the SDK (based on the same document).

I installed the SDK in my host's

/opt/poky-edison/1.7.2/

directory.

Now I want to compile my makefile based project. Compilation runs fine, but I got an error message:

/mnt/edison-rootfs/usr/include/mraa/uart.hpp: In member function 'std::string mraa::Uart::readStr(int)':

/mnt/edison-rootfs/usr/include/mraa/uart.hpp:132:58: error: 'malloc' was not declared in this scope

char* data = (char*) malloc(sizeof(char) * length);

AFAIK, malloc() is not a cpp compatible function, it should be "new" instead. This makefile used to work, when I pointed it to the Eclipse based SDK, so I checked the Yocto generated image, only to find, that the mraa in the Yocto image is an old version.

opkg list | grep mraa

libmraa-dbg - 0.7.2-r0

libmraa-dev - 0.7.2-r0

libmraa-doc - 0.7.2-r0

libmraa0 - 0.7.2-r0

For the makefile based project I need to have identical includes and libraries on both the /opt/poky-edison/1.7.2/ and on the Edison. How could I upgrade the mraa and upm libraries and headers parallel on both locations?

0 Kudos
18 Replies
idata
Community Manager
132 Views

Hello if,

 

 

You can do it by setting up the repos, I'd suggest you to use the same configuration that I use:

 

 

In the directory /etc/opkg, modify the iotkit.conf file with the following content:

 

 

src iotdk-i586 http://iotdk.intel.com/repos/3.0/iotdk/i586/

 

src iotdk-intel-core-2-32 http://iotdk.intel.com/repos/3.0/iotdk/intel_core2_32/

 

src iotdk-x86 http://iotdk.intel.com/repos/3.0/iotdk/x86/

 

src iotdk-core-2-32 http://iotdk.intel.com/repos/3.0/iotdk/core2-32/

 

src mraa-upm http://iotdk.intel.com/repos/3.0/intelgalactic/opkg/i586/

 

 

Then you can run the commands:

 

 

opkg update

 

opkg install mraa

 

 

Or if you require a specific version of mraa, you can go to:

 

 

http://iotdk.intel.com/repos/1.5/intelgalactic/

 

http://iotdk.intel.com/repos/2.0/intelgalactic/

 

http://iotdk.intel.com/repos/3.0/intelgalactic/opkg/i586/

 

http://iotdk.intel.com/repos/3.5/intelgalactic/opkg/i586/

 

 

There you will find the .ipk files of all the mraa versions that have been made available. You can download them directly to your Edison with the command wget DOWNLOAD_LINK and install them with the command opkg install DOWNLOADED_FILE.

 

 

I hope this helps you.

 

-Peter.
IIstv
New Contributor I
132 Views

Thank you Peter,

How can I do the same modification to my /opt/poky-edison to keep it identical to my edison board?

Istvan

idata
Community Manager
132 Views

I'm sorry, I don't understand what you mean. Are you trying to update mraa in the SDK? Or, do you refer to something else?

 

 

-Peter.
IIstv
New Contributor I
132 Views

Sorry, I was vague.

Yes, this is wat I mean. I'd like to have the same libs and includes in the SDK as I have on the Edison.

Istvan

idata
Community Manager
132 Views

Hi if,

 

 

I've never tried to do this on the SDK. Let me check what I can find out about it and if I find anything useful I'll post it here.

 

 

-Peter.
idata
Community Manager
132 Views

Hi if,

 

 

I apologize for the delay in my response. In order to have the latest libraries on the SDK environment, you would need to build the mraa and upm libraries from source as mentioned in https://github.com/intel-iot-devkit/mraa/blob/master/docs/building.md and in https://github.com/intel-iot-devkit/upm/blob/master/docs/building.md after sourcing the toolchain environment. Please take a look at those guides, give it a try and let us know if you run into any issues.

 

 

-Peter.
idata
Community Manager
132 Views

Hello if,

 

 

Do you have any updates about this? Do you still need help?

 

 

-Peter.
GGerh
New Contributor I
132 Views

Hi,

sorry for abusing your thread but, i also built the image by using the sources iot-devkit-yp-poky-edison-20160606.zip. It worked fine to change the repos for opkg and update mraa. But i would like to change the mraa version in the recipe so i can build an image with the latest mraa version for my edison. i looked at the recipe and the inc file, i tried to change the version by renameing the .bb file to _1.3.0 but that dont work properly ? is there an updated recipe for the mraa library ?

idata
Community Manager
132 Views

Hi gerrik84k,

 

 

As you mentioned, updating the mraa recipe is not as simple as to just change the recipe's name to the latest version. You will have to modify the recipe as well as to add any additional modules this new version requires to be able to build it correctly.

 

 

If you would like to learn more about how to add modules to the image, I'd suggest you to read Yocto's Mega Manual ( http://www.yoctoproject.org/docs/1.7.2/mega-manual/mega-manual.html)

 

 

Let me know how it goes.

 

-Peter.
Brendan_L_Intel
Employee
132 Views

So renaming the recipe to _1.3.0.bb should work. If that doesns't work check the recipes here: https://github.com/ostroproject/meta-intel-iot-middleware/tree/master/recipes-devtools/mraa meta-intel-iot-middleware/recipes-devtools/mraa at master · ostroproject/meta-intel-iot-middleware · GitHub.

You may have to disable the java bindings, Remove java here from the BINDINGS variable -https://github.com/ostroproject/meta-intel-iot-middleware/blob/master/recipes-devtools/mraa/mraa.inc... L27 meta-intel-iot-middleware/mraa.inc at master · ostroproject/meta-intel-iot-middleware · GitHub

GGerh
New Contributor I
132 Views

Thanks for your answer, that worked fine for me, now i tried this also with v1.5.1 when i now list the mraa version by

opkg list | grep mraa.

I get this Output

 

libmraa0 - 0.7.3 - mraa built using CMake

mraa - 0.9.5-r0 - Low Level Skeleton Library for Communication on Intel platforms Low

mraa - 0.9.5-r0 - Low Level Skeleton Library for Communication on Intel platforms Low

mraa - 1.5.1 - mraa built using CMake

mraa - 1.5.1-r0

mraa-dbg - 0.9.5-r0 - Low Level Skeleton Library for Communication on Intel platforms -

mraa-dbg - 0.9.5-r0 - Low Level Skeleton Library for Communication on Intel platforms -

mraa-dev - 0.9.5-r0 - Low Level Skeleton Library for Communication on Intel platforms -

mraa-dev - 0.9.5-r0 - Low Level Skeleton Library for Communication on Intel platforms -

mraa-dev - 1.5.1-r0

mraa-doc - 0.9.5-r0 - Low Level Skeleton Library for Communication on Intel platforms -

mraa-doc - 0.9.5-r0 - Low Level Skeleton Library for Communication on Intel platforms -

mraa-doc - 1.5.1-r0

is this all up to date ? why so many different versions ? is this the latest version libmraa0 - 0.7.3 ?

GGerh
New Contributor I
132 Views

Hi,

i tried to update by creating a new layer and copied the recipe to /meta-mylayer/recipes-devtools/mraa/

as i see for newer versions of the mraa its necessary to add icedtea7-native package. This is located in the meta-java layer which i added to my bblayers.config. The icedtea7-native requires x11 support so i added the image feature to my edison-image.bb IMAGE_FEATURES += "x11" unfortunately i still get an error building my edison-image:

Loading cache: 100% |# | ETA: 00:00:00

Loaded 2058 entries from dependency cache.

Parsing recipes: 100% |# | Time: 00:00:01

Parsing of 1570 .bb files complete (1569 cached, 1 parsed). 2057 targets, 163 skipped, 0 masked, 0 errors.

NOTE: Resolving any missing task queue dependencies

NOTE: multiple providers are available for jpeg (jpeg, libjpeg-turbo)

NOTE: consider defining a PREFERRED_PROVIDER entry to match jpeg

ERROR: Nothing RPROVIDES 'xauth' (but /home/intrsol/edison-src/out/linux64/poky/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb RDEPENDS on or otherwise requires it)

ERROR: xauth was skipped: missing required distro feature 'x11' (not in DISTRO_FEATURES)

NOTE: Runtime target 'xauth' is unbuildable, removing...

Missing or unbuildable dependency chain was: ['xauth']

NOTE: Runtime target 'packagegroup-core-x11' is unbuildable, removing...

Missing or unbuildable dependency chain was: ['packagegroup-core-x11', 'xauth']

ERROR: Required build target 'edison-image' has no buildable providers.

Missing or unbuildable dependency chain was: ['edison-image', 'packagegroup-core-x11', 'xauth']

xauth is part of the packagegroup-core-x11.bb and should be installed automatically ?

packagegroup-core-x11 is also in the core-image.bbclass

so what i'm doing wrong has anybody already worked with the x11 on the edison ?

idata
Community Manager
132 Views

Have you tried using the icedtea7-native recipe provided by Openembedded? In case you haven't, you can find it in https://layers.openembedded.org/layerindex/recipe/2162/

 

 

Let us know if the issues persist even with this recipe.

 

-Peter
GGerh
New Contributor I
132 Views

i already use the openembedded recipe...

idata
Community Manager
132 Views

Hi gerrik84k,

 

 

I'm facing a similar issue when trying to update the mraa version directly on the image. Let me check what might be happening. If I find something useful I will make sure to post it here.

 

 

-Peter.
idata
Community Manager
132 Views

Those are all the versions available in the repo currently set on your Edison. In order to check the version you have installed you have to enter the command:

 

 

opkg list-installed | grep mraa

 

 

Let me know if it helps.

 

-Peter.
GGerh
New Contributor I
132 Views

Thanks for your answer, that helped but what i would like to know is, is libmraa0 - 0.7.3 the latest version. if i search for mraa its seems to me that libmraa and mraa is used synonymously ?

idata
Community Manager
132 Views

Currently the latest version of mraa is 1.5.1. The packages libmraa and mraa are indeed used synonymously, this is because libmraa's name was changed to simply mraa a few versions ago.

 

In case you need to update to the latest version of mraa and you have the package libmraa installed, you'll have to remove it first. You can do so with the following command:

 

 

opkg remove libmraa --force-removal-of-dependent-packages

 

 

Then you can install the latest version of mraa with the command:

 

 

opkg install mraa

 

 

Hope that helps.

 

-Peter.
Reply