Sunday 3 April 2016

Thoughts about Brexit

It seems that older people are in favour of leaving the EU, and in general younger people are going to vote to stay in. Well, I have two thoughts about this.

1. The young should consult the old and find out why they want to leave. Usually it is because they voted for a European economic community (which isn't working) and didn't want to have rules of a European political entity imposed on them by faceless unelected bureaucrats.

2. The young do not have a spirit of adventure, and are not willing to face new challenges. The world has changed from the constancy of the 1970's and is very volatile. Britain should become it's own nation again and use the spirit of Nelson and Drake to become it's own master once again.

24/4/16 Barack Obama has just come to the UK and told us how to vote, thus antagonizing a whole bunch of brits that don't like being told what to do by a foreigner. But the question is, what does David Cameron have to do to pay POTUS for coming over and making that speech?

2/5/16 from the Capital & Conflict email: [It's quite strong. I had to put it all.]

Save British Justice

By Christopher Gill

“Safer, stronger and better off” says the prime minister, to which one might retort “how can we possibly be safer if, as might potentially happen to any one of us, we can be arrested without the least shred of evidence that we have indeed committed an offence.”

Not many people know that this is the current state of affairs and, for reasons that are not hard to discern, neither the PM nor his sycophantic ministers want us to know! In spite of the best efforts of those of us who are totally opposed to any dilution or abandonment of the defences which, heretofore, have ensured that individual British subjects are protected against state-inspired coercion, in November 2014 the government led by David Cameron took steps to reconfirm Britain’s support for the iniquitous European Arrest Warrant (EAW). 

Cameron did not need to do this – no treaty obligations would have been broken if he had simply said “thanks, but no thanks” – but he did so in spite of substantial opposition from his own backbenchers and while all the time hypocritically saying he wanted to see powers repatriated back to the UK!

The power that he gratuitously and wantonly gave away to the totalitarian European Union is the power of the state to deprive its citizens of their liberty – in other words, the ultimate power of statehood – and he gave it away to a group of nations whose criminal justice systems, with the honourable exceptions of Ireland and Malta, are totally alien to our own and whose shameful record of incarcerating entirely innocent people speaks for itself. 

The learned opinion of Jonathan Fisher QC (see www.tfa.net under Publications/Research) is that the EAW negates the law of habeas corpus – the law of habeas corpus once having been described on Radio 4, by no lesser person than Archbishop Desmond Tutu, as “such an incredible part of freedom”.

The simple reason why habeas corpus was “such an incredible part of freedom” was because it prevented the powers-that-be from arresting a suspect unless, within 24 hours, they could produce evidence, in open court, that the accused had in fact committed an offence and were thus able to charge him or her accordingly.

During the parliamentary passage of the Extradition Bill, which in 2003 put the EAW onto the statute book , government justified its actions by claiming that there was an “equivalence” between UK law and that extant in other EU member states – an equivalence that, frankly, didn’t exist then and doesn’t exist now!

All the defences and protections against false accusation, arbitrary arrest and wrongful imprisonment, that have historically been enjoyed by defendants in the UK and other common law countries, such as trial by jury; the presumption of innocence; the right to silence; the inadmissibility of hearsay evidence; the withholding of the defendant’s previous convictions; press reporting restrictions and (until recently) protection against double jeopardy; not to mention the aforesaid law of habeas corpus, are virtually unknown in continental Europe.

The EU’s concept of a just and equitable criminal justice system is their embryonic corpus juris which mirrors the criminal justice systems extant on the continent, modelled upon the “Code NapolĂ©on” with its roots in the Inquisition and certainly not, as with our own system, with its roots in Magna Carta. 

Ironically, while in 1215 the barons were prevailing upon King John to append the royal seal to Magna Carta, the pope in Rome was at the very same time imposing the Holy Inquisition. To this day the continental systems of criminal justice remain “inquisitorial”, with the onus upon defendants to prove their innocence, which is, of course, totally contrary to the “adversarial” systems of common law countries where the onus is firmly upon the prosecution to establish guilt.

Another little known feature of the EU’s contingency planning is the establishment of the office of European Public Prosecutor (EPP) who will be superior to all national public prosecutors and who will, of course, do the bidding of his EU political masters. 

Work on the establishment of the office of EPP is scheduled in the current EU work programme but is highly unlikely to manifest itself before 23 June for fear of frightening the horses (ie, the British electorate who are, as yet, blissfully ignorant of the repressive legal system which will almost certainly be imposed upon us should we be foolish enough to vote to remain within the benighted EU).

Already in being is the European Gendarmerie Force (see www.eurogendfor.eu) – an EU organisation with its training facilities at Vicenza in Italy. What possible use could be envisaged for such an armed para-military force other than to ensure that the EU’s writ is enforced throughout its territories? In this connection let us not forget that James Brokenshire MP, a Conservative Home Office Minister in the last parliament, in answer to a parliamentary question by Dominic Raab MP, stated that HMG would be prepared to invite “special intervention forces” (aka the EGF) onto British soil if the need arose. The problem with that is that once here the EGF, being answerable only to Brussels, would leave only if ordered by Brussels to do so. In other words we would effectively be under EU occupation.

The only way to be sure that the horrors I have outlined above – “the elephant in the room” that our prime minister and others of his persuasion do not wish us to see – do not deprive us and generations as yet unborn of our individual freedom, is to vote to leave. As someone once famously said, “the price of freedom is eternal vigilance” and never was vigilance more necessary than at the present time!


And add Theo Paphitis  (Dragon's Den) thoughts
The IMF’s article titled ‘Exit could cause severe damage’ (BBC.co.uk) was rather misleading, as the key point is surely that a ‘UK exit from the EU would “disrupt and reduce mutual trade and financial flows’.  Scaremongering again.  This story’s true meaning actually does far more for the Vote Leave campaign and some of the conjecture out there.

http://www.theopaphitis.com/theos-blog-walking-and-chewing-gum-at-the-same-time/

[6/5/15] From Daniel Hannan Book A Doomed marriage:

Margaret Thatcher observed that Britain's problems had come from Europe, and the solutions from the rest of the world. 

Also that before we joined the EU, we controlled 75%? of the fisheries around Britain, now the EU controls it and we have access to only a small portion.

8 May 2016 - Michael Gove on the Andrew Marr Show

Gove said that we give so Many Billions to the EU, Andrew Marr replied that we get a lot of it back.
Gove replied that we get back what they want to give us, and without guarantees, and the EU could change it, and also that they tell us where to spend it. 

What he didn't say is that if we Remain, they could put up our contribution. 

11 May 16  - Are we Fools? 

http://www.telegraph.co.uk/business/2016/05/10/government-treating-uk-public-like-fools-in-brexit-debate-says-f/

Following on from Trevors posts on FB I have been looking into the fisheries. The UK used to have a lot of fishing areas, but the EU has assigned areas so that we have a lot fewer. They have also put in a quota system which can be considered good as it has helped stocks to grow. A  recent article http://www.telegraph.co.uk/comment/11305123/No-end-to-the-EUs-crazy-fishing-policy.html implies that this has destroyed Britain's Fishing fleet, but this article says that it was good: https://www.opendemocracy.net/can-europe-make-it/griffin-carpenter/eu-common-fisheries-policy-has-helped-not-harmed-uk-fisheries-0 

So I don't know what to believe. 

13 May 2016   And Hargreaves Speaks out:

Peter Hargreaves is willing to take the other side of the trader. The billionaire owner of Hargreaves Lansdown told The Guardian that a vote to leave will be like Dunkirk again. That was eerily familiar. The Fleet Street Letter Investment Director Charlie Morris was all over “the financial Dunkirk moment” Brexit has brought us to, months ago. 

Hargreaves used the same metaphor. But he means something different. He suggested that the very uncertainty created by Brexit will be a catalyst for positive change. It’s like Brexit is a disruptive technology. He says:

It would be the biggest stimulus to get our butts in gear that we have ever had… It will be like Dunkirk again… We will get out there and we will be become incredibly successful because we will be insecure again. And insecurity is fantastic… All the people in the City of London who I rate and are intelligent and talk sense actually say it would better if we left… All the government lackeys, all the bureaucrats and the people on the boards [who] haven’t got a clue what they are talking about want us to remain.



Saturday 2 April 2016

RC-Car-1 RAspberry Pi to drive ex-RC car

27-10-17 New comments at end.
------------------------------------------

22-2-16, Finally got Raspbian Jessie wirelessly connected to network on IP 192.168.1.8.  errors and struggle was due to wrong ESSID. [note _ instead of - ]

 I have installed Apache as per the instructions I am currently following. and have connected to apache base page.


see:


27-2-16 Testing basic html on R-Pi.    Have nicked  buttons from here as the ones that I found didn’t format nicely.  These do OK.


Now I have taken my LED blink program that tested three GPIO ports and edited it so that different buttons  with different GPIOs. On each prog I have cut out two ports. I have  read up how to call Python direct from HTML, which seems to use CGI anyway.   This needs testing.


I have discovered that the connections on my GPIO breakout box are correctly labelled. the labels P17 stand for GPIO17 which is actually pin 11 on the GPIO pins.


The programs now refer to that in the naming as blink17/22/23.


Then things like how to terminate the python program when you leave the button for left/right, and how the stop will stop the forward action.


I have just discovered that I have a permissions problem with the blink programs.  ssh into it and change permissions of the blinkxx.py files to 777. It still just lists the files.


1/3/16 Have asked question of the web site above, but no response yet. Am looking at




but he uses a feature called fastcgi. that is more complex.


and:
https://www.raspberrypi.org/forums/viewtopic.php?f=31&t=96200 has some comments. I haven’t tried it yet.

---------------------------  ----------------------

3/4/16 I have made two attempts using samples that I found on the Internet.

This attempt number three

26/3/16 This one is going to be developed using the notes from


and mostly from


27/3/16 New card; Raspbian Jessie 18/3/16, wired into router, IP=192.168.1.19 (found with fing from tablet)
ssh into it,
Ssh -l pi 192.168.1.19 from Drive/R-Pi-initial setup
then expand filesystem using sudo raspi-config, and reboot
Sudo apt-get update
Sudo apt-get upgrade
sudo apt-get install zd1211-firmware
sudo apt-get wpasupplicant  [ though it may already have the latest]
sudo apt-get install lighttpd


configure network from Drive/wireless Configuration
configure wpa-supplicant using nano on the unit.
reboot wireless
For once it worked first time

how do I get WebIoPi tar file on to the R-Pi? Download it to kubuntu, copy it on to the SD card, and:
It is very easy to install WebIOPi on the Raspberry Pi. You have to download the WebIOPi file from the WebIOPi homepage and extract the file. After this you have to install WebIOPi and that is it. To do so you need a few commands I listed here:
The command to extract the WebIOPi tar file: tar zxvf WebIOPi-0.7.0.tar.gz
Now you have to change the directory to the folder where the WebIOPi files are extracted to.
With the next command you will install WebIOPi on your Raspberry Pi:
[sudo python setup.py install]    Invalid 
sudo ./setup.sh    works     [13/11/2017]
Now WebIOPi is available and can be used.
------------ ------------ ------------
WebIOPi successfully installed
* To start WebIOPi foreground : sudo webiopi [-h] [-c config] [-l log] [-s script] [-d] [port]
* To start WebIOPi background : sudo /etc/init.d/webiopi start
* To start WebIOPi at boot : sudo update-rc.d webiopi defaults      - must do this next time I connect to th R-Pi
----------- ----------- -------------
Put rapi_car_webio.html in www/html directory and it was picked up by browser.
So far so good. 
Hardware:
Had a look at the car. The rear wheels are driven via relays, and it looks like one of the inputs to the circuit is via a capacitor, even though they are DC motors. There is a chip that does all the intelligent stuff from receiving the RF signal to driving outputs. [SCRX2FS] Unfortunately, the spec sheet for this chip is in Chinese, but the pinouts are in English, so perhaps I can sort that out.



Here is a picture of both sides of the PC board in these cars. In the two relays the lines to the rear wheels are held at ground unless a relay is energised, then the motor drives. I have noticed that the line to the motor from one relay goes through a capacitor, so I wonder if they are driven by PWM as many seem to be.


Just southwest of the IC are two surface mount transistors that switch the relays (Q2, Q3). The multiple wires (blue,green,orange,yellow,red) run to the front wheel steering module. I don't know how they work. 

[6 April 16] From the spec sheet I found at the bottom a circuit diagram.

This shows which pinouts of the chip drive what.  [I am not sure how to make this image darker].

It does show me how For [11] and Back[10] drive the rear wheels, and Left [7] and Right [6] steer. 

I just need to know what all these other lines running to the steering box do. Guess it's time to open it up.   Blue and Green drive the motor. Brown, orange, yellow, and red are a Gray code wheel with brown as the common, for feedback.  That's not in this circuit diagram! 


My current thoughts are that If I remove the chip, I can use those pinouts to drive the motors directly from the Raspberry Pi. 

[10 April 16] Current problems are working out how this gray code thing on the steering works as feedback  for the control. As I have no circuit diagram it is difficult.
Secondly, looking at the python code for driving the car, it has two drive motors, one for each side and steers by adjusting the PWM for these motors. I'll try it just to see if it works before modifying it. 

[12 April 16] No, I need to modify the code, or else if I try it it will turn as well as go. I need to separate the two functions. Motor 1 is driven by pins 22 and 27, Motor 2 by 24 & 25.  What I propose is to change the code in the sections for Forward/Back Left and Right to Motor 1 being forward and back, motor 2 being Left/Right. 

[15 April 16] edited rapi_car_webio.py file to comment out the motors that I did not want to drive for forward/reverse/left and right. 

now need to test with LEDs

[19 April 16] connected LEDs to pins 24 & 25, set webipoi to run at startup, and also started it, but couldn't get LEDs to light. Must put in modified Python Program to test.

[20 April 16] Noticed that the HTML program does not call the Python Program. Funny. Look again and look at the webIOPi site and see how it should work, otherwise ask author of cardboard car.
The Python Program should be called script.py  and edit /etc/webiopi/config  to specify locations. 

[24 April 16] searched for webiopi debugging on internet and found
 https://www.raspberrypi.org/forums/viewtopic.php?f=37t=78471  This indicates that I also need to edit  /etc/init.d/webiopi  to specify file names and restart service. Didn't find this in webiopi instructions. 
Debugging output commands suggested after doing this are 'systemctl status webiopi.service' and 'journalctl -xn'.


[13 June 16]  On one of the PCB's I ripped out the chip and connected a USB connector to the 5v and Ground contacts. On the two tabs out of the chip to the Transistors for the rear motor I connected wires. I touched these to the +,gnd and the motors jumped - well and good. 

On another set of back wheels without the PCB, I touched +3 volts to it and the wheels spun- Therefore it is a direct drive motor and not a PCM driven one. 


[Oct 27 2017]  Have been struggling to find a battery to drive the motors, but I picked up another RC car at the tip and it contained a Li-Ion battery. A real treasure of a find. I have  charged it up using a 9 Volt/ 0.8 Amp power supply and a 100 ohm resistor, and soldered the leads out of my new find onto the board of my RC car. It all works a treat. It goes very fast, so I think I'll have to look into some sort of PCM speed control. This is available in webIOPI.  

Comments on charging: I found a 4 pin square connector from an old PC PSU, and two of the pins were in the correct orientation for the plug on the battery so it was cut down to provide the charger connector.   I monitored both the current and the voltage on a couple of power supply units before using this one. 

[Nov 9, 2017] Observations. 
It works, But has no speed control. Forward is forward at full speed, as is reverse, and Left and right immediately crank the wheels over hard until I stop them, which usually means it has done at least one complete circle. In  script.py There is  no code about them, so I have added lines to control the turning and switch it off after 300msec. 

But so far I am pleased.

[10/11/17]  I can't stop. I now have put in Left/right turn controls with 300msec  bursts of turn into the python script, and it works on the LED test rig. Must try it in the car now. For the record, this is SD card #4.