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: 4-20mA Current Loop - Raspberry Pi Issue
PostPosted: Mon Dec 08, 2014 11:30 pm 

Joined: Mon Dec 08, 2014 11:02 pm
Posts: 2
Hello,

I am using the 4-20mA sensor board. I have followed your tutorial and have made the board work with Arduino. Easy to do, Great!

In reality, I need to make the sensor board work with Raspberry Pi. I have followed your tutorial from downloading the arduPi library and currentLoop library. I just want to run the "4_20_connectionstate.o" example. I can compile the code without any error messages using the following ---> g++ 4_20_connectionstate.cpp arduPi.cpp currentLoop.cpp -o 4_20_connectionstate. I execute the output with the command ---> sudo ./4_20_connectionstate.o.

Here is the problem, the output always returns the following regardless of channel selected or if the sensor is ON, OFF, or even connected ---> Voltage = 5.001992 V, Current = 20.143232 mA. Besides testing each channel, I have not edited the code.

The arduPi and currentLoop libraries are saved in the same folder.

Any ideas why this is happening? Could you suggest anything for me to try? I am doubtful that my RPi is defective, I have run some python scripts controlling the GPIO pins.

Thanks in advance for any help because I couldn't find a similar forum question.

hp3525


Top
 Profile  
 
 Post subject: Re: 4-20mA Current Loop - Raspberry Pi Issue
PostPosted: Tue Dec 09, 2014 9:09 am 

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

try with these lines:
Code:
g++ -c arduPi.cpp -o arduPi.o

g++ -c currentLoop.cpp -o currentLoop.o

g++ -lpthread -lrt 4_20_connectionstate.cpp arduPi.cpp currentLoop.cpp -o 4_20_connectionstate


You didn't include the words "-lpthread -lrt". Besides this, you should not get a "4_20_connectionstate.o" but a "4_20_connectionstate" file.

So now you must write:
Code:
sudo ./4_20_connectionstate


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:


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.