New effort

I have neglected this site for a long time, so most of the content was very outdated.

I am now approaching retirement, so I thought I might start it up again to pass the time, and perhaps entertain or help some total strangers.

 

Advertisements

Giving up sugar

Let’s face it giving up sugar is really difficult.
So many products on the market that are marketed as “healthy” are anything but.
Even something as basic as bread has added sugar, because it makes the bread quicker to rise, easier to cook and last longer on the shelf.

Yet you can make perfectly good bread with four ingredients: flour, water, salt and yeast.
I bake my own Wholemeal bread, simply because it is the only way that I can eat bread guaranteed to have no sugar in it.

It really is that bad.

We start training our children to like sugar early in their lives, often before they are even weaned.

Breakfast cereals: sugar, sugar, sugar.

The only sugar free options that I could find in my local supermarket were puffed rice, shredded wheat and porridge.

“No added sugar” or “Sugar free” are often a deliberate attempt to mislead the consumer, and often disguise the addition of all sorts of sugar.

Products with this label often include Fructose, Maltose, Dried fruits, or even honey, all of which contain sugar. Often artificial sweeteners which are of little benefit to your body are added as well.

Refined Fructose is one of the worst sugars you can consume, but I have seen it marketed as “healthy fruit sugar”.

Fruit sugars are fine in fruit, but juicing removes all of the fibre and most of the nutrients leaving what is basically fruit flavoured sugar water, removing the water makes it even more damaging.

Dried fruits are only marginally better, the drying process damages the fibre and destroys much of the nutrition of the fruit, leaving a sort of chewy sugar paste.

Once you try to go low carb, it gets even worse. Many products contain absolutely no information about their carbohydrate content.

It is only when you start looking closely at labels that you realise how much unnecessary stuff is packed into many of the things that we eat, and how much nutrition has been removed to ensure a long shelf life.

As an example, yoghurt is most commonly pasteurised. This gives it a longer shelf life, but destroys the natural probiotics it contains, and ruins the flavour, so fruit is added to make it more palatable to our sugar conditioned tastebuds. Often refined sugars are added to sweeten it even more. Sugar is also a  preservative.

My home made yoghurt has the consistency of heavy cream or custard, and a mild, slightly sharp taste. I like it without any additives, but add a few berries, and you have a delicious dessert.

 

 

 

Moving an ACT!Pro 2018 database to a shared drive.

I recently had to do this for a customer, and despite many people saying it is impossible, or saying that you need ACT! installed and licensed on the target machine, (and indeed if you have it is far simpler) once you step through it, it works quite well.

Originally they had set up ACT! on their server, but had never activated it, so the trial period had elapsed by the time they came to set up their second workstation.

They wanted to move their ACT!Pro database from their first workstation to their server so that it would be backed up by their backup software, and they could use it from their 2 workstations independently.

You do need ACT! to have been installed on Both PCs at some point.

The reason this was complicated was that the customer only had 2 licenses, both of which were in use. However, you can run ACT! in trial mode for 30 days, and even after that has expired (which was the case here), the SQL backend remains functional unless you uninstall it.

So here are the steps. This comes with NO WARRANTY, so not for the faint hearted.

I advise you to take multiple backups and check and repair as much as possible.

I will try to add some screen shots later.

Moving an ACT!Pro database to a shared drive.

1.Backup database, do a check and repair, and backup database again.

2.Make a copy of the database from within ACT!, tick “share this database”.

3.Open the newly copied database to verify it, then close it and close ACT!

4.Launch ACTdiag.exe

5.Select the new database and detach it.

6.Copy the entire new database folder to a shared drive on a PC which has had ACT! installed so has MSSQL backend. ( You can use the trial version) DELETE THE ORIGINAL FOLDER, otherwise ACT! may continue to use the local database-files folder.

7.Open the .pad file in the new folder with notepad and edit the hostname and share path to match new host and share path., then save

8.Launch actdiag.exe on the new host

9.Use actdiag.exe to attach the newly copied database and also change the storage location to the new host. (this is the sub folder “<databasename>-database files”)

10.Directly share the new database’s “<database-name>-database files” folder.

11.Open from shared drive, (ACT! may verify it before you can open it).

12.Tidy up

I have advised that they get a license for the server act! install, but for now they are sorted. They can even run the ACT! scheduler for backing up etc.


			

16 x 2 character I2C LCD display

Recently imported some Backlit LCD displays, white on blue.They are Generic 16 character by 2 line displays, showing text white on a blue background by using a white backlight.

While these displays can be linked directly to an Arduino , Raspberry Pi or similar, these use the I2C bus system.

I2C is also known as two wire, and is a serial bus that uses only two wires for transmitting data and controlling devices.

All I2C devices have an address on the bus, which must be different for each device. most of the  units I have bought so far have come with a default address 0x3F, although one had a default of 0x27. They have 3 sets of solder pads (A0-2)  that, when bridged, add 10K pull-up resistors to change the address.

They have a jumper to disable the backlight, but of course the characters are then not visible. They also have a potentiometer to adjust the backlight intensity,

This is the sketch I used to test them with an Arduino Uno:

/*—–( Declare Constants )—–*/
/*—–( Declare objects )—–*/
// set the LCD address to 0x3F for a 16 chars 2 line display
// Set the pins on the I2C chip used for LCD connections:
//                    addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

/*—–( Declare Variables )—–*/
//NONE

void setup()   /*—-( SETUP: RUNS ONCE )—-*/
{
  Serial.begin(9600);  // Used to type in characters

  lcd.begin(16,2);   // initialize the lcd for 16 chars 2 lines, turn on backlight

// ——- Quick 3 blinks of backlight  ————-
  for(int i = 0; i< 3; i++)
  {
    lcd.backlight();
    delay(250);
    lcd.noBacklight();
    delay(250);
  }
  lcd.backlight(); // finish with backlight on  

//——– Write characters on the display ——————
// NOTE: Cursor Position: (CHAR, LINE) start at 0  
  lcd.setCursor(0,0); //Start at character 4 on line 0
  lcd.print(“Hello, world!”);
  delay(1000);
  lcd.setCursor(0,1);
  lcd.print(“Hello World”);
  delay(8000);  

// Wait and then tell user they can start the Serial Monitor and type in characters to
// Display. (Set Serial Monitor option to “No Line Ending”)
  lcd.clear();
  lcd.setCursor(0,0); //Start at character 0 on line 0
  lcd.print(“start typing now”);
  lcd.setCursor(0,1);
  lcd.print(“LCD display test”);  

}/*–(end setup )—*/

void loop()   /*—-( LOOP: RUNS CONSTANTLY )—-*/
{
  {
    // when characters arrive over the serial port…
    if (Serial.available()) {
      // wait a bit for the entire message to arrive
      delay(100);
      // clear the screen
      lcd.clear();
      // read all the available characters
      while (Serial.available() > 0) {
        // display each character to the LCD
        lcd.write(Serial.read());
      }
    }
  }

}/* –(end main loop )– */

/* ( THE END ) */

 

 

Calibrating a 5″ Raspberry Pi touchscreen in Jessie

Previously, I posted about a 5″ touchscreen for the Raspberry Pi.

But I did not mention calibrating the touchscreen.

After a week’s holiday, I came back and sorted this fairly easily.

I was using Raspbian Jessie from NOOBS 1.8

First I installed a new utility:

sudo apt-get install xinput-calibrator

 Calibration

To calibrate the touchscreen, go to the menu>preferences>select “Calibrate touchscreen”

Touch each of the red crosses on the screen in turn, then cut and paste the resulting snippet to the following file by using this command:

sudo nano /usr/share/X11/xorg.conf.d/98-calibration.conf

(this will create a new file and open it for editing)

My entries are below:

Section “InputClass”

Identifier “calibration”

MatchProduct “ADS7846 Touchscreen”

Option “Calibration” “120 3970 205 3920” #(enter your numbers here)

Option “SwapAxes” “0”

EndSection

Ctrl-O to save, Crtl-x to exit, and then reboot, and your pointer should follow your finger correctly!

Orange Pi One

This is just a quick and dirty guide to getting the Orange Pi One up and running.

First steps:

  1. DON’T connect a microUSB charger to the MicroUSB port. That port is for USB On the go only, i.e. for connecting flash drives etc.
  2. You will need a 5V power supply with a 4mm x 1.7mm barrel connector, centre positive. I used a USB to barrel connector lead, and a Samsung USB charger, which can easily supply 2A. Apparently PSP chargers work as well.
  3. You will need an SDcard for the OS. At least 8GB and preferably at least class 4. A fast one is recommended, apparently the Opi1 may not boot with a slower one.
  4. EDITED:I have since found that some class 10 cards will not work with the OPi1 or even the Raspberry Pi. I used class 4 Kingston 8GB cards, and they work perfectly with both.
  5. If you power on the OPi1 without a properly set up SDcard, nothing will happen, except that the LEDs on the Ethernet port will light. THIS IS NORMAL.
  6. Prepare the SDcard. I followed this excellent guide: http://www.cnx-software.com/2016/03/16/orange-pi-one-board-quick-start-guide-with-armbian-debian-based-linux-distribution/
  7. Once connected up with a valid Boot image, the Ethernet port LEDs light up, followed after a pause of about 20 seconds by the red LED and then the green one will flicker as the system loads. (note on some boards the green LED lights first)
  8. Note: I noticed that if the Ethernet port is not connected, it takes a lot longer to start up.

I have added a Youtube video showing a working Orange Pi One  (and a faulty one)

5″ touchscreen for a Raspberry Pi

Recently bought a Generic 5″ touchscreen from AliExpress.

Model number ZC37200

resolution 800×480

XPT2046 touch controller.

Excellent quality, but getting it working was a bit of a trial.

Many of the tutorials out there are misleading, outdated, or just plain wrong.

This is what I did:

 

First (easy part), connect it all up, and install Raspbian from NOOBS 1.8.

Either open a terminal or from another PC:

ssh pi@<IP address of your pi>

First the easy part, we get the screen working with a full display.

Because these small screens will only display at native resolution, you may get a partial screen display, or a distorted one.

You need to force native resolution, in the case of the 5” display, that is 800×480.

edit /boot/config.txt

sudo nano /boot/config.txt

edit these lines as follows:

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (here we are forcing 800x480)
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0

The next step is to enable the touchscreen.

In the same file, remove the # from this line:

dtparam=spi=on

and add this line:

dtoverlay=ads7846,penirq=25,speed=10000,penirq_pull=2,xohms=150

save and reboot, everything worked!

Next we need to calibrate it, but I need more time to work that one out, will post in the next few days.

 

 

 

 

 

Sugar free…..No, Really Sugar free.

A recent diagnosis of Type 2 Diabetes has caused me to take stock.

So no more snacking, no more high sugar recipes, Healthier alternatives..

I was quite interested when I saw The Great British Bake Off listing a sugar free  round, then I watched it and was horrified.

Nobody came up with a sugar free recipe.

They all used sugar substitutes, such as  Agave Nectar, Molasses or Honey.

Now, Honey may have trace elements and add flavour, but at the end of the day, it is still a sugar syrup.

Agave nectar is a highly processed product loaded with Fructose (even higher than HFCS), which is arguably worse for you than granulated sugar.

Let’s be honest people, recipes using Honey, Agave Nectar or Molasses aren’t “sugar free”.

I suppose that you could call them “healthier sugar”, although even that label is debatable.

Although they are sweeter than table sugar, so you might be able to use less, they are still sugar.

They are certainly not good for diabetics.

So, I am going to investigate sugar alternatives.

MythTV and a TBS HDTV (DVB-T2) Card

HDTV cards with Linux support are fairly few and far between. Although TBS support Linux, you have to compile the driver yourself.

(and again every time you update your kernel).

I Use mine in a MythTV server, running Mythbuntu 14.04

Quad core AMD 5350 Kabini processor, Asus  AM1-A miniITX motherboard, 4GB RAM, and a TBS 6280 HDTV PCIe Dual DVB-T2 tuner card.

I found that to get smooth 1080p video on the device’s screen, , the proprietary AMD drivers were necessary.

MythTV works well, I am using Kodi (XBMC) on devices around the house for streaming.

Downloading and compiling TBS HDTV card drivers

First you need to add the tools: Zip, GCC and headers:

sudo apt-get install p7zip-full unzip build-essential linux-headers-generic-$(uname -r)

TBS driver downloads:
latest one:
http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v150525.zip
or paste this into a terminal:
wget http://www.tbsdtv.com/download/document/common/tbs-linux-drivers_v150525.zip

Some people have reported problems with the latest driver, here is where to get an earlier version:
http://www.tbsdtv.com/download…
or paste this into a terminal:
wget http://www.tbsdtv.com/download…

In terminal (assuming you are in your home directory, and you downloaded the TBS driver into Downloads)
mkdir tvdrivers
cd Downloads
for the latest version:
cp tbs-linux-drivers_v150525.zip /home/tvdrivers

cd /home/tvdrivers
unzip tbs-linux-drivers_v150525.zip
tar xjvf linux-tbs-drivers.tar.bz2
cd linux-tbs-drivers

for version 141019:
cp
tbs-linux-drivers_v141019.zip /home/tvdrivers

cd /home/tvdrivers
unzip tbs-linux-drivers_v141019.zip
tar xjvf linux-tbs-drivers.tar.bz2
cd linux-tbs-drivers

for both versions:
check for version (32bit or 64bit)
uname -a
for 32 bit:
sudo ./v4l/tbs-x86_r3.sh
for 64 bit:
sudo ./v4l/tbs-x86_64.sh
You should see “TBS drivers configured for (32bit or 64 bit) platform”
sudo make

go and make a cuppa
once complete :
sudo make install
and when complete, reboot.

v4l files are stored at:
/lib/modules/(your kernel version)/kernel/drivers/media
If you have problems, it may be worth clearing this directory before compiling.
You can find out your kernel version with the command:
uname -r
You can make sure you have the correct kernel headers with the command:
sudo apt-get install linux-headers-$(uname -r)

More info and links here:
http://linuxtv.org/wiki/index….

Back from the the brink…

Sometimes the easiest things become difficult.
I decided to swap the monitor on my living room PC.
The new monitor is physically the same size, despite having a slightly larger (23″ as opposed to 22″) visible screen. It also has a higher resolution, 1920×1080 instead of 1640×1050. So I thought it would fit nicely in the bookcase where the current Samsung was.
First problem: no VESA mount, so needs the stand.
Had to move one of the shelves.
Homemade bookcase, screwed together, but not too much of a problem.
Half an hour later, boot up, on HDMI lead. no picture.
Close down, boot on vga ok.
Reboot, oops, caught power lead, pc switched off, Boot up, kernel panic.
After a short google, downloaded and tried Rescatux recovery CD.
Brilliant package! PC working again.
Now just have to figure out why monitor not working with HDMI>DVI lead.(sigh)