Libelium is offering new technical support channels, to contact with de Technical Support team to solve any issue our doubt please contact with your sales agent or visit our contact site



Post a new topicPost a reply Page 1 of 1   [ 2 posts ]
Author Message
 Post subject: BG96 4G shield + Cooking Hacks Bridge + ArduPi library
PostPosted: Thu Dec 19, 2019 4:49 pm 

Joined: Thu Dec 19, 2019 3:56 pm
Posts: 1
Hi,
I recently owned a raspberry Pi 4 and i want to connect on it a 4G module (more accurate a BG96 4G arduino compatible shield).
In order to do that I managed to purchase a Raspberry Pi to Arduino Shield Connection Bridge

according to the tutorial https://www.cooking-hacks.com/documentation/tutorials/raspberry-pi-to-arduino-shields-connection-bridge
the code works fine for arduino uno, but when trying to compile the arduPi library from cooking hacks it seemed to be corrupted . The following error occurred when trying to manually compile the arduPi.cpp (arduPi.o file doesn't exists after successful installation of the libraries):

Code:
[color=#FF0000]misiakoulis@misiakoulis:~/Desktop/cooking/arduPi$ g++ -c arduPi.cpp -o arduPi.o
arduPi.cpp: In constructor ‘SPIPi::SPIPi()’:
arduPi.cpp:920:20: error: cast from ‘uint8_t* {aka unsigned char*}’ to ‘uint32_t {aka unsigned int}’ loses precision [-fpermissive]
     if (((uint32_t)mapaddr % PAGESIZE) != 0)
                    ^
arduPi.cpp:921:42: error: cast from ‘uint8_t* {aka unsigned char*}’ to ‘uint32_t {aka unsigned int}’ loses precision [-fpermissive]
         mapaddr += PAGESIZE - ((uint32_t)mapaddr % PAGESIZE) ;
                                          ^
arduPi.cpp:925:18: error: cast from ‘void*’ to ‘int32_t {aka int}’ loses precision [-fpermissive]
     if ((int32_t)spi0 < 0){[/color]


When I edit the ArduPi.cpp file in order to delete the SPIPi() constructor, where it seems to be the problem, the code compiled successfully.
My problem is that now when I am trying to compile my arduino code with the arduPi library a whole bunch of errors appeared. The arduino code runs successfully in arduino uno with the Bg96 4g shield.

According to the following template.cpp in the section /*Your arduino code here*/, it supposed to be pretty simple. If I understand correctly you have to copy your working arduino code in this section and compile the code with
Code:
g++ -lrt -lpthread MY_PROGRAM.cpp arduPi.o -o MY_PROGRAM


Code:
[color=#FF0000]//Include arduPi library
   #include "arduPi.h"

   /*********************************************************
    *  IF YOUR ARDUINO CODE HAS OTHER FUNCTIONS APART FROM  *
    *  setup() AND loop() YOU MUST DECLARE THEM HERE        *
    * *******************************************************/

   /**************************
    * YOUR ARDUINO CODE HERE *
    * ************************/

   int main (){
      setup();
      while(1){
         loop();
      }
      return (0);
   }[/color]


But when I am trying to compile my code a lot of errors appeared. I will attached the initial code and the errors in the end of this post.
I even try to compile an empty sketch like the above mentioned template.cpp. Again I am falling into errors:
Code:
[color=#FF0000]g++ -lrt -lpthread test.cpp arduPi.o -o arduino

/usr/bin/ld: arduPi.o: in function `attachInterrupt(int, void (*)(), Digivalue)':
arduPi.cpp:(.text+0x418c): undefined reference to `pthread_create'
/usr/bin/ld: arduPi.cpp:(.text+0x419c): undefined reference to `pthread_cancel'
/usr/bin/ld: arduPi.cpp:(.text+0x41b4): undefined reference to `pthread_create'
/usr/bin/ld: arduPi.o: in function `detachInterrupt(int)':
arduPi.cpp:(.text+0x4278): undefined reference to `pthread_cancel'
collect2: error: ld returned 1 exit status[/color]


It seems to me that there might be a problem with the arduPi library.
Can you please provide me with some help, in order to understand what might be the problem.


Top
 Profile  
 
 Post subject: Re: BG96 4G shield + Cooking Hacks Bridge + ArduPi library
PostPosted: Thu Dec 26, 2019 2:30 pm 

Joined: Mon Sep 28, 2009 12:06 pm
Posts: 11366
Hi,

We are sorry but we haven't tested the arduPi libraries using a Raspberry Pi 4 so we aren't sure if they are compatible.

Did you follow the step of the 3.2 Enabling Interfaces section before installing the libraries?

Did you download the library using this command?
Code:
wget http://www.cooking-hacks.com/media/cooking/images/documentation/raspberry_arduino_shield/raspberrypi2.zip && unzip raspberrypi2.zip && cd cooking/arduPi && chmod +x install_arduPi && ./install_arduPi && rm install_arduPi && cd ../..


Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 2 posts ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use.