Menu Close

Installing the bechele software from scratch

My recommendation is to use one of the images provided for download. However, if you want to use a different mini PC, where no image is provided for, you may also install the bechele software from scratch via git or from the provided gzipped tar file from the download page. Generally you need to expect things not running nicely trough, at least I always had to struggle around with different things like missing devices, not activated i2c, kernel modules to load etc. Since we need support for several devices and methods, be prepared for some “adds”

The following assumes an installation on Raspbian – on a different disribution it might be slightly different.

apt-get update
apt-get upgrade (select all default)
apt-get install vim
apt-get install libi2c-dev
apt-get install minicom
apt-get install mpg123
apt-get install git

git clone https://github.com/wiringpi

How to build wiringPi:
To get it running on a Raspi 3b (it ran nicely on a 1b) I had to modify the file wiringPi.c in the wiringpi/wiringPi directory. Line 768 and 769 I had to comment out:

// Start by looking for the Architecture to make sure we're really running
//      on a Pi. I'm getting fed-up with people whinging at me because
//      they can't get it to work on weirdFruitPi boards...

  while (fgets (line, 120, cpuFd) != NULL)
    if (strncmp (line, "Hardware", 8) == 0)
      break ;

 // if (strncmp (line, "Hardware", 8) != 0)   <<<<<< modified
 //   piGpioLayoutOops ("No \"Hardware\" line") ; <<<<<< modified

  if (wiringPiDebug)
    printf ("piGpioLayout: Hardware: %s\n", line) ;

# cd wiringpi
# ./build clean
# ./build 

apt-get install cpanminus
cpanm RPi::MultiPCA9685
cpanm WiringPi::API
apt-get install libncurses5-dev libncursesw5-dev
cpanm Curses::UI
cpanm Device::SerialPort --verbose (otherwise we get into a timeout)
cpanm File::Find::Rule
cpanm Linux::Joystick
cpanm Time::HR
cpanm Audio::Play::MPG123

In addition I had to activate some special stuff:

joystick device: I had to load the kernel module joydev with "modprobe joydev"
in addition it was necessary to add a udev rule to /etc/udev/rules.d/99-js0.rules: The following entry was required: KERNEL=="js0" SYMLINK+="js0"

i2c-device: 
I had to uncomment / add the follwing line in /boot/firmware/config.txt:
dtparam=i2c_arm=on 
On some other it was necessary to add the referring dtoverlay

serial device: 
I had to uncomment / add the follwing line in /boot/firmware/config.txt:
enable_uart=1
on Armbian it was in /boot/armbianEnv.txt:
overlays=i2c-1 i2c-0 uart3

On some I had to add entries in /etc/modules.load.d:
joydev
i2c-dev

As really weird worked out, that obviously the default configuration for the serial port pins 8 and 10 on the GPIO header on RaspberryPi3b is instable. Means the port frequency follows the vcore frequency and is therefore variable, that results in unstable serial communication. ( I just ask myself who ever tested this ?!)
Finally it helped to disable Bluetooth:
edit /boot/config.txt
Add at the end of the file:
dtoverlay=disable-bt
And disable:
systemctl disable hciuart

see also: https://www.abelectronics.co.uk/kb/article/1035/serial-port-setup-in-raspberry-pi-os 

finally copy the provided tar ball to / and unpack with:
tar -xvzf bechele3.tar.gz
The binaries should end up in /usr/local/bin ...
The sample files should end up in /home/bechele3

After editing/adapting /usr/local/bin/bechele/Modules/CondigL.pm to your needs, you should be able to run the software.

Perhaps it may be helpful to add the /usr/local/bin/bechele directory to your PATH variable. This makes it easier to run the commands.

Good luck ....