FreeBASIC, RPIv2, Hazeltine 1500 Terminal

Linux specific questions.
Post Reply
JenniferLucille
Posts: 1
Joined: Jun 30, 2018 22:28

FreeBASIC, RPIv2, Hazeltine 1500 Terminal

Post by JenniferLucille »

Hi, newbie to FreeBasic here.

I'm attempting to port over a FreeBASIC .BAS file that was working on a x86 laptop running Ubuntu 18.04 LTS onto a Raspberry PI v2 running Ubuntu MATE 1.16.1

The scenario works like this. I have a folder on the Desktop with ASCII art in it and the .BAS file reads the contents of the folder and sends the output over a USB to Serial adapter and displays the ASCII art onto the screen of a restored Hazeltine 1500 terminal. The ASCII art is written to the display every 15 seconds or so, operating kind of like a screensaver - but the only purpose of the whole configuration is to show the ASCII art on the Hazeltine 1500 screen.

Here's the thing. The whole thing works great on Ubuntu 18.04 LTS, even on a Chrome Cube running Ubuntu as well, but for the life of me I cannot get it to work running on the Raspberry PI. I've installed FreeBASIC from the Sourceforge site, all the dependencies and the Terminfo files for the Hazeltine are all loaded. Our programmer friend who wrote the code to get and write the ASCII art has also written a ttyUSB0.service file for us and that is also in the same place on the RPI as on the Ubuntu installs (/lib/systemd/system/ttyUSB0.service).

Our programmer tells me that it is normal for the executable he compiled to run from the Terminal emulator window on the desktop of basically any Ubuntu install and that is due to that Terminal emulator window being vt100 compatible but the Hazeltine is not compatible. When I try to run the same command to initiate the ASCII art drawing from the Hazeltine, I simply get [6n at the display and nothing else.

He says I should 'recompile with current version of FreeBASIC' but when I try to do that, this is the error I'm getting.
Desktop/ASCII art$ fbc -lang qb KRAFTWERK.BAS
bash: /usr/local/bin/fbc: cannot execute binary file: Exec format error
I would like it to work on a tiny thing like a Raspberry PI so I could put the RPI inside the Hazeltine case and it would appear to be more like magic that the ASCII artwork appears on the Hazeltine screen after entering a few commands from the Hazeltine keyboard.

Any advice this group can give me on what I'm doing wrong is greatly appreciated. There are so many different "how-to troubleshoot FreeBASIC" sites that refer to different versions or it running on different hardware that I've gone cross-eyed and don't know what to try next (because I know so little about FreeBASIC or Ubuntu/Linux).

I'm comfortable at the Cisco wireless controller command line and GUI but dang, Linux is a different beast.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: FreeBASIC, RPIv2, Hazeltine 1500 Terminal

Post by caseih »

These are more Linux system questions than FB questions. But I can answer them if I get a bit of clarification. I'm not really clear on what is and is not working. So the binary running on the Ubuntu machine displays correctly on the Hazeltine terminal? Does the program write directly to the serial port, or are you running a getty on the serial port, and thus on the Hazeltine terminal? In other words do you get a login prompt on the Hazeltine when you run it on the Ubuntu box? Does the Pi put a login prompt on the Hazeltine terminal?

If the answer to the last two questions is yes, on the working Ubuntu Hazeltine setup, what is the terminal type set to? Type "env | grep TERM" at a command prompt. After that we can talk about how to get the Pi's termianl type right.

As for the recompile issue, the problem there is that the Pi requires a compiler built for the ARM 32-bit CPU architecture. The FB compiler you've downloaded is almost certainly for Intel machines. There are no official binaries available for the Pi, but there are several folk who have built recent versions of FB for the Pi. Perhaps one of them can comment here on where to find it.
srvaldez
Posts: 3373
Joined: Sep 25, 2005 21:54

Re: FreeBASIC, RPIv2, Hazeltine 1500 Terminal

Post by srvaldez »

you can get the latest FB Git build from http://users.freebasic-portal.de/stw/builds/
there's a Rpi version in linux-armv6-rpi/ but the version in linux-armv7a-hf-debian/ works OK on Rpi3, not tested on Rpi2 but it may work also on the pi2 as there seem to be little difference between armv6 and armv7a http://single-boards.com/armv6-vs-armv7/
St_W
Posts: 1619
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: FreeBASIC, RPIv2, Hazeltine 1500 Terminal

Post by St_W »

The RPI2 already has an ARMv7 CPU, so the ARMv7 build should definitely work. It just won't work on the RPI1 (including RPI Zero), which use an ARMv6 CPU. See also https://en.wikipedia.org/wiki/Raspberry ... ifications

btw ARM is backwards compatible, so an ARMv6 executable will also work on ARMv7 (RPI2) or ARMv8 (RPI3) CPUs. The executable may just be faster if it uses the latest instruction set supported by the CPU it runs on.

The FreeBasic packages from http://users.freebasic-portal.de/stw/builds/ just contain a minimal set of headers; if you use any third-party libraries you probably also need to download http://users.freebasic-portal.de/stw/bu ... eaders.zip and add those to your freebasic include folder.
To install fbc in /usr/local (default) use "chmod +x install.sh && ./install.sh"
Post Reply