Programming the TXT on Linux without ROBOPro

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
hvn
Beiträge: 259
Registriert: 20 Feb 2011, 11:15

Programming the TXT on Linux without ROBOPro

Beitrag von hvn » 06 Mai 2015, 23:02

Hi,

Last week I received my TXT Discovery set and updated the firmware to 4.1.6. When logged in on the TXT via WiFi and ssh I was happy to see the /dev/ files since it is Linux. However, since I use Linux instead of Windows I do not use ROBOPro, and I need to know which /dev/... file belongs to I1..I8, M1 - M4 and C1 - C4 so I can use these interfaces/connectors. Could you please share this information and the kind of data (digital/analog, range) ?
During the Convention last year, I asked Ralf Knobloch about Linux support and he assured me that a Linux driver and/or API would be released, although it would be in binary form to protect the IP. Is it possible to give a timeline for this ?
Is it known which file format is used to create the image from the camera ?

Thank you for your answers.

hvn

Benutzeravatar
Dirk Haizmann ft
fischertechnik Mitarbeiter
Beiträge: 1126
Registriert: 09 Nov 2010, 08:48

Re: Programming the TXT on Linux without ROBOPro

Beitrag von Dirk Haizmann ft » 07 Mai 2015, 10:22

Hello hvn,

the "TXT Controller Open Source Archive" can be downloaded from the download area on our Website.

The images of the camera are in the jpeg-format.

ft

hvn
Beiträge: 259
Registriert: 20 Feb 2011, 11:15

Re: Programming the TXT on Linux without ROBOPro

Beitrag von hvn » 07 Mai 2015, 14:56

Hallo ft,

I downloaded the archive and searched through it, but I can't find the /dev/... information about e.g. which /dev/ file corresponds to I1. Could you tell me which file contains this information ?
On the camera image: so if I copy the contents of framebuffer /dev/fb0 to a file, e.g. image.jpg, I should be able to view it? Because that is what I did, and I got the message that the first bytes of the file did not indicate a jpeg file.

Thank you,

hvn

Benutzeravatar
ft-ninja
Beiträge: 113
Registriert: 01 Nov 2010, 14:26
Wohnort: Inner Mongolia
Kontaktdaten:

Re: Programming the TXT on Linux without ROBOPro

Beitrag von ft-ninja » 19 Mai 2015, 00:21

Hello hvn,

I successfully used following sequence to obtain JPEG images from FT usb camera locally on TXT:

1. Login to TXT via SSH (uid/psw=ROBOPro/ROBOPro)
2. From home dir execute: ./var/psg/WebCam/Test.sh &
This script starts mjpg_streamer with output_http plugin active on port 8080.
3. Again from home dir request the image from mjpg_streamer with following command: wget -Oimg.jpg http://127.0.0.1:8080/?action=snapshot
4. Now you will get img.jpg file with captured imagein home dir.

By the way, you can use step 3 on your Linux PC. Just replace IP address in wget command.

Best regards
==
ft-ninja

hvn
Beiträge: 259
Registriert: 20 Feb 2011, 11:15

Re: Programming the TXT on Linux without ROBOPro

Beitrag von hvn » 19 Mai 2015, 09:40

Hello ft-ninja,

Thank you very much for your answer. This works nicely.
I do hope any of you can also answer my question about which /dev/... file corresponds to which I1-I8/M1-M4/C1-C4 connection.

Kind regards,

hvn

Benutzeravatar
Dirk Haizmann ft
fischertechnik Mitarbeiter
Beiträge: 1126
Registriert: 09 Nov 2010, 08:48

Re: Programming the TXT on Linux without ROBOPro

Beitrag von Dirk Haizmann ft » 20 Mai 2015, 13:30

We will publish a detailled description for the onlinemode in the download area within the next days.

ft

hvn
Beiträge: 259
Registriert: 20 Feb 2011, 11:15

Re: Programming the TXT on Linux without ROBOPro

Beitrag von hvn » 01 Jun 2015, 10:50

Hello ft,

Since your reply "within the next days" is almost 2 weeks ago, can you indicate when it will be published ?

Thank you.

hvn

Benutzeravatar
Dirk Haizmann ft
fischertechnik Mitarbeiter
Beiträge: 1126
Registriert: 09 Nov 2010, 08:48

Re: Programming the TXT on Linux without ROBOPro

Beitrag von Dirk Haizmann ft » 15 Jun 2015, 08:13


hvn
Beiträge: 259
Registriert: 20 Feb 2011, 11:15

Re: Programming the TXT on Linux without ROBOPro

Beitrag von hvn » 15 Jun 2015, 20:28

Hi ft,

Thank you for the description.

hvn

Benutzeravatar
Dirk Haizmann ft
fischertechnik Mitarbeiter
Beiträge: 1126
Registriert: 09 Nov 2010, 08:48

Re: Programming the TXT on Linux without ROBOPro

Beitrag von Dirk Haizmann ft » 16 Jun 2015, 08:14

You're welcome!

ft

hvn
Beiträge: 259
Registriert: 20 Feb 2011, 11:15

Re: Programming the TXT on Linux without ROBOPro

Beitrag von hvn » 16 Jun 2015, 18:59

Hi ft,

Since I use Linux, I gladly find that most of the /Common content is prepared for use with Linux as well by the use of #ifdef WIN32. However, Main.cpp in /MotorOnOffSwitch is not, and I added #ifdef WIN32 and after errors on SOCKET I replaced these occurrences with int (i.e. integer). Next, compilation ends with 7 cases of "undefined reference" to ftIF2013TransferAreaComHandler which would indicate a library problem.
Assuming that my previous actions were correct, could you tell what the problem might be ?

hvn

Benutzeravatar
schnaggels
Beiträge: 389
Registriert: 31 Okt 2010, 23:14
Wohnort: Kelkheim
Kontaktdaten:

Re: Programming the TXT on Linux without ROBOPro

Beitrag von schnaggels » 17 Jun 2015, 14:12

Hello ft,

I couldn't find any example for the display access.
1) Will this be added later please?

The structure TXT_SPECIAL_INPUTS defines variable u16TxtPower for the supply voltage. Especially for mobile robots it's important to monitor the energy level. As the AV input is already build into ROBOpro it would be a shame to waste one of the regular I1-I8 inputs for this...
2) So would it be possible for the ROBOpro developer to map this to the AV input like we had for the ROBO-Interface please?

Thanks,
Thomas

Benutzeravatar
Dirk Haizmann ft
fischertechnik Mitarbeiter
Beiträge: 1126
Registriert: 09 Nov 2010, 08:48

Re: Programming the TXT on Linux without ROBOPro

Beitrag von Dirk Haizmann ft » 18 Jun 2015, 16:12

@hvn
Please check the informations in this zip-file

http://www.fischertechnik.de/ResourceIm ... ?raid=8757

I think this will solve your problem.

ft

hvn
Beiträge: 259
Registriert: 20 Feb 2011, 11:15

Re: Programming the TXT on Linux without ROBOPro

Beitrag von hvn » 18 Jun 2015, 17:25

ft,

The information I assume you refer to on page 2 of the pdf file is for use with Visual Studio. Since I'm running Linux, I can't use that. Could you provide information how to setup this with e.g. Eclipse in Linux ?

hvn

vleeuwen
Beiträge: 1567
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Programming the TXT on Linux without ROBOPro

Beitrag von vleeuwen » 18 Jun 2015, 22:24

The C++ file are normal strait forward unmanaged C++.
The run also under MS-Visual Studio 2013.

Install Eclipse and start a new C++ project.
And insert/copy the TXT C++ code into your project.
It is low level programming so you will need good knowledge of C++ programming including memory management and the C++ libraries for sockets.
Unmanaged C++ doesn't have a garbage collect.

hvn
Beiträge: 259
Registriert: 20 Feb 2011, 11:15

Re: Programming the TXT on Linux without ROBOPro

Beitrag von hvn » 19 Jun 2015, 15:19

My problem right now isn't with memory management or garbage collection but about paths and location of a library. When I want to use g++ (since it's all in C++) the options are -I (capital i) for headerfiles e.g. .h/.hpp and -l (small L) for library files e.g. .a/.so. In the .vcproj file relative paths are given, but when I try compilation with header option -I it results in the earlier mentioin "undefined reference" and the library option -l results in "cannot find". So I still like to get information on this.

Benutzeravatar
ft-ninja
Beiträge: 113
Registriert: 01 Nov 2010, 14:26
Wohnort: Inner Mongolia
Kontaktdaten:

Re: Programming the TXT on Linux without ROBOPro

Beitrag von ft-ninja » 20 Jun 2015, 16:40

Hello hvn,

before compiling the MotorOnOffSwitch on Linux you need to port it form Windows sockets realization to Linux -> replace winsock calls to analogs in sys/sockets.h. http://stackoverflow.com/questions/4617 ... ux-sockets.
==
ft-ninja

Benutzeravatar
Dirk Haizmann ft
fischertechnik Mitarbeiter
Beiträge: 1126
Registriert: 09 Nov 2010, 08:48

Re: Programming the TXT on Linux without ROBOPro

Beitrag von Dirk Haizmann ft » 22 Jun 2015, 16:16

I'll move this topic to "Computing"

NooN
Beiträge: 8
Registriert: 22 Aug 2015, 10:41
Wohnort: Rhein-Neckar Region

Re: Programming the TXT on Linux without ROBOPro

Beitrag von NooN » 02 Sep 2015, 16:41

Hello FT,

should the line in common.h

Code: Alles auswählen

typedef signed int          INT32;
not be

Code: Alles auswählen

typedef signed long          INT32;
On a 64bit machine int is not 32bit and some calculations will break.

Greetings
NooN

Antworten