C console examples for Linux

Post your C and C++ discussions here
Post Reply
AndrewA
PICO STAFF
PICO STAFF
Posts: 198
Joined: Tue Oct 21, 2014 3:07 pm

C console examples for Linux

Post by AndrewA » Wed Jun 01, 2016 12:02 pm

Hello all,

The current update to Linux has removed C console examples and build scripts. This in preparation to separate all SDK code examples from driver and executables.

I have attached Linux built scripts and updated C console examples.

Below are instructions to install and build the example for the USB TC-08 datalogger.

You will need to change the commands for other devices.
This device/driver table maybe useful-
topic15321.html

The packages have been provided on our Debian/Raspbian(new) repositories.

Code: Select all

deb http://labs.picotech.com/debian/ picoscope main
For Raspbian use the following:

Code: Select all

deb http://labs.picotech.com/raspbian/ picoscope main
Every package is signed with or key, so in order to verify them the public part has to imported:

Code: Select all

wget -O - http://labs.picotech.com/debian/dists/picoscope/Release.gpg.key | sudo apt-key add -
To pull/update repositories cache run

Code: Select all

sudo apt-get update
Install the driver

Code: Select all

sudo apt-get install libusbtc08
copy attached files-
autogen.sh
usbtc08con.c
To-
/opt/picoscope/share/doc/libusbtc08

copy one of the PicoStatus.h files from one the include folders to usbtc08 one- (loggers only)

Code: Select all

cp /opt/picoscope/include/libps3000a-1.1/PicoStatus.h /opt/picoscope/include/libusbtc08-1.8/
Install complier and build.

Code: Select all

sudo apt-get install build-essential autoconf automake make libtool
cd /opt/picoscope/share/doc/libusbtc08
sudo ./autogen.sh
sudo make
Attachments
linux_C_console-2016-06-01.zip
linux C console files
(107.18 KiB) Downloaded 482 times
Regards Andrew
Technical Specialist

gioboske
Newbie
Posts: 0
Joined: Thu Nov 24, 2016 8:00 pm

Re: C console examples for Linux

Post by gioboske » Thu Nov 24, 2016 9:34 pm

Hello Andrew,
thank you for this information.
I followed step by step your post to build some of the attached C examples on a Raspberry Pi 2. All the required packages are installed correctly and updated to the latest version available on the repository. However every time I try to run autogen.sh script, I get the following error:

Code: Select all

autoreconf: 'configure.ac' or 'configure.in' is required
Since I'm not familiar with autoreconf, I need some help to figure out what is happening.
Any pointers?

Thank you,
gioboske

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: C console examples for Linux

Post by Hitesh » Fri Nov 25, 2016 9:13 am

Hi gioboske,

Which PicoScope/PicoLog driver package have you installed?

Regards,
Hitesh

Technical Support Engineer

gioboske
Newbie
Posts: 0
Joined: Thu Nov 24, 2016 8:00 pm

Re: C console examples for Linux

Post by gioboske » Mon Nov 28, 2016 9:03 am

Hi Hitesh,
I'm interested in Series 2000 (PicoScope 2203), so I first installed ps2000 driver.
However I also tried with other drivers, including libusbtc08 (following step by step the example posted by AndrewA), with the same result.

Thank you,
Regards

gioboske
Newbie
Posts: 0
Joined: Thu Nov 24, 2016 8:00 pm

Re: C console examples for Linux

Post by gioboske » Wed Nov 30, 2016 10:50 am

UPDATE:
I also installed the drivers on Ubuntu 15.04 and then I tried to compile the C example for PS2000.
Same problem when running autogen.sh:

Code: Select all

autoreconf: 'configure.ac' or 'configure.in' is required
gioboske

gioboske
Newbie
Posts: 0
Joined: Thu Nov 24, 2016 8:00 pm

Re: C console examples for Linux

Post by gioboske » Wed Nov 30, 2016 2:05 pm

UPDATE 2:
I found the missing "configure.ac" file, by installing the old driver (ver. 2.1.43r14) downloaded from: http://labs.picotech.com/raspbian/pool/ ... _armhf.deb

Now "autogen.sh" exits without errors.
Please include the "configure.ac" files in the attached C examples.

Thank you,
gioboske

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: C console examples for Linux

Post by Hitesh » Thu Dec 01, 2016 11:34 am

Hi gioboske,

Sorry for the delay in getting back to you but good to hear that you were able to find the configure.ac file.

We are in the process of determining how best to distribute examples to allow driver only installs.

Below are the files for the (lib)ps2000 driver:
PS2000con_Linux.zip
PS2000 Linux files
(13.84 KiB) Downloaded 259 times
Regards,
Hitesh

Technical Support Engineer

antonyLHart
Newbie
Posts: 0
Joined: Thu Oct 04, 2018 11:57 am

Re: C console examples for Linux

Post by antonyLHart » Thu Oct 18, 2018 2:24 pm

PS2000con_Linux.zip
Regards,
I have downloaded these files into /opt/picoscope/share/doc/libps2000a/

I have processed configure.ac with autoconf like this: sudo autoconf configure.ac this only produces a autom4te.cache folder and I am getting the following errrors.

configure.ac:10: error: possibly undefined macro: AM_INIT_AUTOMAKE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:25: error: possibly undefined macro: AM_DISABLE_STATIC
configure.ac:31: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.ac:40: error: possibly undefined macro: AM_LDFLAGS

Am i missing something?

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: C console examples for Linux

Post by Hitesh » Fri Oct 19, 2018 9:18 am

Hi antonyLHart,

Which device are you using? If it is the PicoScope 2204A or 2205A, you will need the libps2000 driver package.

I would recommend obtaining the files from our GitHub respository as these are up-to-date:

https://github.com/picotech/picosdk-c-examples

If you are using the PicoScope 2204A or 2205A please use the ps2000Con.c file into the linux-build-files directory and run the following commands:

./autogen.sh
make

If you are using a PicoScope 2000 Series device which uses the ps2000a API functions (check the Programmer's Guide for your device) then you will need the files from the ps2000a directory in the repository.

Regards,
Hitesh

Technical Support Engineer

antonyLHart
Newbie
Posts: 0
Joined: Thu Oct 04, 2018 11:57 am

Re: C console examples for Linux

Post by antonyLHart » Fri Oct 19, 2018 12:47 pm

To anyone else struggling to run the c examples please do the following:
(Connect up your device first)

1. Download the necessary drivers as described above

2. Unzip attached folder contents to /opt/picoscope/share/doc/libps2000

3. (note from readme file) Your system must be set up in such a way that all users who need to use
the driver have write access to the USB device (Linux only). Driver installation
package automatically installs 95-pico.rules to /etc/udev/rules.d/
and creates pico group to correctly initialise permissions upon device
being connected to the system. In order to use it you need to add your
user to pico supplementary group:

sudo usermod -G pico your_username

and run following command to login to this group:

newgrp -

4. Navigate to directory:
cd /opt/picoscope/share/doc/libps2000

5. Simply grant permissions and run the setup file:

sudo chmod +x setup
./setup

As I am very new to linux, I actually spent quite some time getting this to work. Thats why I created the 'setup' script in order to help others in the same position. I hope this does help!
Attachments
PS2000con_Linux.zip
(14.03 KiB) Downloaded 19 times

Post Reply