Lost network connection with Ubuntu upgrade?

April 17, 2017

Did you upgrade your Ubuntu installation to 16.10 or 17.04 recently?

Did you have an Ethernet connection to the outside world?

Are you now not connected?

If you can answer yes to all these questions, this blog post may be for you. I have found this will fix it. This may not be the best solution however:

sudo rename /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf /usr/lib/NetworkManager/conf.d/_10-globally-managed-devices.conf_backup
sudo service network-manager restart

If you’re not bothered about keeping a copy of the file, just ‘rm’ it.

Casio CFX-9850 serial link to PC.

January 9, 2017

A data-point to place in public domain. This has been explored by others, so there’s nothing novel in this post. The serial RS-232 port has almost disappeared from modern desktop computers. This is a problem if you are looking to connect your Casio 9850 series calculator to your computer. The official FA-122 and FA-123 cables are difficult to source (for a sensible budget), and most (all?) of this series do not have USB.

I have successfully used the Casio FA-124 software, under Windows 7 (64 bit) to communicate with the calculator (CFX-9850G). I used:

  1. An off-the-shelf USB to TTL cable. It must be a 3.3V TTL type, and I’d recommend buying a good quality cable from a reputable seller. The ebay seller usb2ttl is a good place to start.
  2. A bit of 2.54mm single row PCB header. Looks like this.
  3. The Casio SB-62 cable. You may be able to use a 2.5mm stereo extension cable, but the calculator’s shape can make it difficult to use non-Casio cables.
  4. A 2.5mm stereo jack socket (not necessary if you’re cutting up a non-Casio cable).

You only need to make three connections. At the calculator, the tip of the plug is Tx, the ring is Rx and the sleeve is Ground. Connect the Ground to that of the USB to TTL cable, connect calculator Tx to the TTL Rx, and the opposite pair. That’s complete, a set of test leads will work if you’re in a hurry.

Check your computer has not assigned the virtual serial device to something greater than COM9 (if it has, you can change that port number to a single digit). Then the FA-124 software will be able to access it.

p1020829

I acknowledge that my calculator tinkering is not entirely serious:

p1020852

Mandelbrot plotters for BBC BASIC

December 25, 2016

These programs were born out a discussion started at college recently. I had wrote a primitive fractal plotter for the BBC Micro many years ago. Just for fun I started converting it to RISC OS BASIC, but the end program is so far removed from the original it looks like I wrote it beginning with a blank slate.

This is the version for the BBC Micro:

REM Target BBC Micro
MODE 2
xmin=-2.5:xmax=1
xwidth=xmax-xmin
ymin=-1:ymax=1
ywidth=ymax-ymin
xsize%=160:ysize%=256:REM this is the physical size of the MODE 2 screen
:
max%=1024:REM maximum iterations
:
PROCplot(0,0)
PROCplot(2,2)
PROCplot(0,2)
PROCplot(2,0)
PROCplot(1,1)
PROCplot(3,3)
PROCplot(1,3)
PROCplot(3,1)
PROCplot(1,0)
PROCplot(3,2)
PROCplot(1,2)
PROCplot(3,0)
PROCplot(0,1)
PROCplot(2,3)
PROCplot(0,3)
PROCplot(2,1)
:
REPEAT UNTIL INKEY(0)<>-1
END
:
DEFPROCplot(f%,g%)
FOR X%=0 TO (xsize%-1) STEP 4
FOR Y%=0 TO (ysize%-1) STEP 4
a=(xwidth*(X%+f%)/xsize%)+xmin
b=(ywidth*(Y%+g%)/ysize%)+ymin
PROCit(a,b,max%)
h%=7-7*LOG(IT%)/LOG(max%)
IF (ABS(e)+ABS(f))>4 GCOL0,h% ELSE GCOL 0,0
MOVE (X%+f%)*8,(Y%+g%)*4:DRAW (X%+f%)*8,(Y%+g%)*4
NEXT Y%
NEXT X%
ENDPROC
:
DEFPROCit(a,b,ITER%)
IT%=0
e=0
f=0
REPEAT
u=(e*e)-(f*f)+a
v=(2*e*f)+b
e=u
f=v
IT%=IT%+1
UNTIL IT%=ITER% OR (ABS(e)+ABS(f))>4
ENDPROC

This is a similar version for RISC OS 5.22. It may work on earlier versions.

DIM mode% 52, pal% 256*4 
$MODE=STRING$(52,CHR$0) 
$mode%=STRING$(52,CHR$0) 
PROCmode("X1680 y1050 C16M EX1 EY1 F60") 
xsize%=1680:ysize%=1050:REM physical pixels 
aspect=ysize%/xsize% 
 
REM define the centre and scale factor here 
xcentre=-1.44251 
ycentre=-0.13409 
scale=0.52707 
 
xmin=xcentre-(scale/2) 
xmax=xcentre+(scale/2) 
xwidth=xmax-xmin 
ymin=ycentre+(scale*aspect/2) 
ymax=ycentre-(scale*aspect/2) 
ywidth=ymax-ymin 
max%=8192:REM maximum iterations 
FOR X%=0 TO (xsize%-1) STEP 1 
FOR Y%=0 TO (ysize%-1) STEP 1 
a=(xwidth*X%/xsize%)+xmin 
b=(ywidth*Y%/ysize%)+ymin 
REM a is the real component of complex number c 
REM b is the imaginary component of c 
PROCit(a,b,max%) 
REM apply LOG scale 
h%=360-360*LOG(IT%)/LOG(max%) 
IF (ABS(e)+ABS(f))>4 PROCsethsv(h%,&FF,&FF) ELSE SYS"ColourTrans_SetGCOL",0,,,&100,0 
MOVE X%*2,Y%*2:DRAW X%*2,Y%*2 
NEXT Y% 
NEXT X% 
REPEAT UNTIL INKEY(0)<>-1 
END 
: 
DEFPROCit(a,b,ITER%) 
IT%=0 
e=0:REM e and f are the real, imaginary parts of z 
f=0 
REPEAT 
REM z=(z*z)+c 
REM square z, result in u,v 
u=(e*e)-(f*f) 
v=2*e*f 
REM add c, put the result in e 
e=u+a 
f=v+b 
REM count it then quit or bail 
IT%=IT%+1 
UNTIL IT%=ITER% OR (ABS(e)+ABS(f))>4 
ENDPROC 
 
DEFPROCsethsv(h%,s%,v%) 
SYS"ColourTrans_ConvertHSVToRGB",h%*&10000,s%*&100,v% TO r%,g%,b% 
SYS"ColourTrans_SetGCOL",(b%<<24)+(g%<<16)+(r%<<8),,,&100,0 
ENDPROC 
 
DEFPROCmode(mode$) 
FOR i%=1 TO LENmode$ 
MID$(mode$,i%,1)=CHR$(ASC(MID$(mode$,i%,1)) OR 32):REM force A-Z to lower case 
NEXT i% 
smode$=" "+mode$ 
IF INSTR(smode$," x")=0 THEN PRINT" x pixels missing from mode string (="""mode$""") passed to PROCmode.":ENDPROC 
IF INSTR(smode$," y")=0 THEN PRINT" y pixels missing from mode string passed to PROCmode.":ENDPROC 
IF INSTR(smode$," c")=0 AND INSTR(smode$," g")=0 THEN PRINT" colours missing from mode string passed to PROCmode.":ENDPROC 
xpix%=VALRIGHT$(smode$,LENsmode$-INSTR(smode$," x")-1) 
ypix%=VALRIGHT$(smode$,LENsmode$-INSTR(smode$," y")-1) 
col_start%=INSTR(smode$," c") 
IF col_start%=0 THEN col_start%=INSTR(smode$," g") 
colour$="":col_start%+=1:offset%=0 
REPEAT 
colour$+=MID$(smode$,col_start%+offset%,1) 
offset%+=1 
UNTIL MID$(smode$,col_start%+offset%,1)=" " OR (col_start%+offset%)>LENsmode$ 
IF INSTR("c2g2c4g4c16g16c256g256c32kc16m",colour$)=0 THEN PRINT" number of colours specified in """mode$""" is not available." 
IF INSTR(smode$," f")<>0 framerate%=VALRIGHT$(smode$,LENsmode$-INSTR(smode$," f")-1) ELSE framerate%=-1 
IF INSTR(smode$," ex")<>0 THEN ex%=VALRIGHT$(smode$,LENsmode$-INSTR(smode$," ex")-2) ELSE ex%=1 
IF INSTR(smode$," ey")<>0 THEN ey%=VALRIGHT$(smode$,LENsmode$-INSTR(smode$," ey")-2) ELSE ey%=1 
REM put together mode block now. 
pos%=0 
mode%!pos%=1:pos%+=4 
mode%!pos%=xpix%:pos%+=4 
mode%!pos%=ypix%:pos%+=4 
IF colour$="c2" OR colour$="g2" THEN 
mode%!pos%=0:pos%+=4 
mode%!pos%=framerate%:pos%+=4 
mode%!pos%=5:pos%+=4 
mode%!pos%=ey%:pos%+=4 
mode%!pos%=4:pos%+=4 
mode%!pos%=ex%:pos%+=4 
ENDIF 
IF colour$="c4" OR colour$="g4" THEN 
mode%!pos%=1:pos%+=4 
mode%!pos%=framerate%:pos%+=4 
mode%!pos%=5:pos%+=4 
mode%!pos%=ey%:pos%+=4 
mode%!pos%=4:pos%+=4 
mode%!pos%=ex%:pos%+=4 
ENDIF 
IF colour$="c16" THEN 
mode%!pos%=2:pos%+=4 
mode%!pos%=framerate%:pos%+=4 
mode%!pos%=5:pos%+=4 
mode%!pos%=ey%:pos%+=4 
mode%!pos%=4:pos%+=4 
mode%!pos%=ex%:pos%+=4 
ENDIF 
IF colour$="g16" THEN 
mode%!pos%=2:pos%+=4 
mode%!pos%=framerate%:pos%+=4 
mode%!pos%=5:pos%+=4 
mode%!pos%=ey%:pos%+=4 
mode%!pos%=4:pos%+=4 
mode%!pos%=ex%:pos%+=4 
ENDIF 
IF colour$="c256" THEN 
mode%!pos%=3:pos%+=4 
mode%!pos%=framerate%:pos%+=4 
mode%!pos%=5:pos%+=4 
mode%!pos%=ey%:pos%+=4 
mode%!pos%=4:pos%+=4 
mode%!pos%=ex%:pos%+=4 
ENDIF 
IF colour$="g256" THEN 
mode%!pos%=3:pos%+=4 
mode%!pos%=framerate%:pos%+=4 
mode%!pos%=5:pos%+=4 
mode%!pos%=ey%:pos%+=4 
mode%!pos%=4:pos%+=4 
mode%!pos%=ex%:pos%+=4 
mode%!pos%=0:pos%+=4 
mode%!pos%=&80:pos%+=4 
mode%!pos%=3:pos%+=4 
mode%!pos%=&FF:pos%+=4 
ENDIF 
IF colour$="c32k" THEN 
mode%!pos%=4:pos%+=4 
mode%!pos%=framerate%:pos%+=4 
mode%!pos%=5:pos%+=4 
mode%!pos%=ey%:pos%+=4 
mode%!pos%=4:pos%+=4 
mode%!pos%=ex%:pos%+=4 
ENDIF 
IF colour$="c16m" THEN 
mode%!pos%=5:pos%+=4 
mode%!pos%=framerate%:pos%+=4 
mode%!pos%=5:pos%+=4 
mode%!pos%=ey%:pos%+=4 
mode%!pos%=4:pos%+=4 
mode%!pos%=ex%:pos%+=4 
ENDIF 
mode%!pos%=-1 
MODE mode% 
IF colour$="g256" THEN 
FOR c%=0 TO 255 
pal%!(c%*4)=FNadd(c%,c%,c%) 
NEXT 
SYS"ColourTrans_WritePalette",-1,,pal% 
ENDIF 
IF colour$="g16" THEN 
pal%!0=FNadd(&FF,&FF,&FF) 
pal%!4=FNadd(&DD,&DD,&DD) 
pal%!8=FNadd(&BB,&BB,&BB) 
pal%!12=FNadd(&99,&99,&99) 
pal%!16=FNadd(&77,&77,&77) 
pal%!20=FNadd(&55,&55,&55) 
pal%!24=FNadd(&33,&33,&33) 
pal%!28=FNadd(&00,&00,&00) 
pal%!32=FNadd(&10,&10,&10) 
pal%!36=FNadd(&C0,&C0,&C0) 
pal%!40=FNadd(&60,&60,&60) 
pal%!44=FNadd(&20,&20,&20) 
pal%!48=FNadd(&E0,&E0,&E0) 
pal%!52=FNadd(&40,&40,&40) 
pal%!56=FNadd(&A0,&A0,&A0) 
pal%!60=FNadd(&80,&80,&80) 
SYS"ColourTrans_WritePalette",-1,,pal% 
ENDIF 
ENDPROC 
: 
DEFFNadd(r%,g%,b%) 
=(b%<<24) OR (g%<<16) OR (r%<<8)

Feel free to play with them and use the code for what you wish.

This is some example output from BeebEm, using the values:

xmin=-1.49142

xmax=-1.1561

ymin=-0.07797

ymax=0.025735

max%=2048

(I have increased the maximum number of iterations, to try and prevent the image becoming ‘bitty’. This is more important as you decrease the plot window; otherwise known as zooming in)

This image was produced in about 10 hours, with BeebEm emulating a 65C02 co-processor, and with the emulator running at 100x real-time speed.

8bit_mandelbrot

Just for fun here is the same area using the RISC OS program:
29032017.png

Ford Focus Mk2 LED indicators

November 26, 2016

A bit of a technical summary of what you need to do to make them work correctly.

This all started after two things happened in quick succession:

1. Some smart-ass said my indicator was invisible during daylight.

2. An MOT assessor said the paint was peeling off the factory-fit filament lamps, and it may suggest an impending MOT failure next time around. The lamps have to be the correct colour, as well as flash at the correct speed.

The ECU (helpfully … or not) will flash the indicators too quickly if it suspects a lamp has failed. An LED lamp will not pull down the voltage on the indicator supply as much as a filament lamp. This is what the ECU detects, the voltage drop due to the low resistance of the filament lamp. There is no “flash relay” or “flash module” hidden in the vehicle.

To fool the ECU you need to provide some series impedance. The simplest way is to add a low value resistor between the indicator supply and ground. I started with an 8 ohm resistor per side. The resistor is rated at 50W, which is a little over-engineered for something you’ll use intermittently. The simplest way to implement this is in the wiring loom behind the headlamps.

[ If you have changed only the front or rear lamps, one 8 ohm resistor per side is sufficient. If you’ve changed front and rear lamps, you need a 4 ohm resistor per side. You can put two of 8 ohm resistors in parallel to achieve the same thing. ]

Remove the entire headlamp unit, and unplug that 10 way connector. It is a tight fit on to the socket, and there’s a latch to unhook (flat blade screwdriver usually works). The wires are clearly numbered in to the plug. Wire 3 (blue) is the indicator supply, and 6 (black) is ground. Connect the resistance across these wires. I used Scotchlok connectors, cheap and readily available from your local craplins.

Cocoon it in tape, and secure the resistors so they’re not flappin’ in the breeze, re-assemble and test:

20160116_114032

The image shows one 8 ohm resistor. I added a second resistor in parallel because I did the LED upgrade rear first, then upgraded the front lamps later.

Voodoo Wazoo Fat Bike – how to fix it.

October 1, 2016

I bought a ‘Halfords Special’ earlier this year.

I’ve had more than my money’s worth of fun with it since.

As these are built to a price (and it is a bargain as it stands) compromises were made:

  1. The headset bearings lasted about three months in the wetness of the Lake District. I replaced the factory-fit “thing” with a no-name clone of the Hope S.H.I.S. ZS44/28.6 (upper) and ZS44/30 (lower). This gives you cartridge bearings for your 1 1/8″ steerer. Some astute observers suggested that you might use a EC44/40 at the lower, to give you compatibility with tapered steerer tubes. You might want to replace the forks in the future. The factory fitted bearings had no seals installed, so it was not much of a surprise they failed soon.
  2. The bottom bracket failed after about 6 months. What was fitted was a 100mm shell, with a 154.5mm square taper spindle. Made by some cheap manufacturer with bearings made of cheese. This is where it gets weird. Halfords have told me their ‘technical records’ indicate the spindle length is 164mm. I know that one Wazoo left the factory with a 154.5mm spindle…
    Finding a replacement proved to be tricky, and the best that myself and my local LBS could find was an On-One 100x148mm BB. This fits, does not destroy the chain line, nor causes any mechanical issues. It looks like a superior replacement, with doubled-up bearings at each end of the spindle. [ I reserve the right to revise my assessment of the BB at the end of its life ]
    Halfords did suggest I order part number 153878 “BBS Wazoo 2015 BB” for the sum of £16. I have done that purely for the curiosity value.

I wanted to put these technical bits in to the public domain, in case they help other bikers dabbling with fat bikes. The nearest whole bike which can compete with the Wazoo costs around £1000, so it is a compelling choice for an alternative mountain bike.

(7/10/2016) The Halfords part number will provide you with a 154.5mm spindle BB, for a 100mm BB shell. I think I will continue buying the On-One part, on the basis that it is more likely to survive being wet once or twice.

Update 31/12/2016

3. Freehub info: The Halfords part number for the freehub is 341740 “FHB CB/Car/VD Splin F”. You need to insert a 12mm allen key in to the hub from the non-drive side to release the freehub. The seals on the cup-and-cone bearings are poor, so you’ll be re-greasing the bearings frequently (or never getting the bike wet).
There are some letters stamped on one of the splines “JdT”, I don’t know if this is a model designation or a maker’s mark.

As an aside, a Shimano 10 speed cassette (CS-M771-10) fits on that freehub, with what appears to be sufficient thread engagement on the lock-nut. I haven’t tried an 11 speed MTB cassette on it yet, only because I don’t have a spare sitting on the shelf.

Update 23/1/2017

4. The factory-fit cable to operate the rear dérailleur lasted a bit longer than my cynical self expected. I have replaced it with a sealed and continuous run of outer and inner, to keep the water and muck out.

5. Another recommendation; inspect the jockey wheels on the dérailleur. If they do not turn freely then disassemble, clean, pack with light grease before reassembly. When an entire rear mech. costs under £10, you get what you pay for.

Update 15/2/2017

Yes, a Shimano Deore XT M8000 (11-42) 11-speed cassette fits on the freehub, sufficient thread engagement on the lock nut etc. No obvious fouls or pitfalls to my (un)trained eyes.

BBC iplayer “loophole”.

September 1, 2016

Everyone has their $0.02, and so do I.

Since the fanfare-like announcements in recent weeks I was mildly curious. Today, as I type, I am downloading Series 2, Episode 5 of the BBC documentary series “Inside The Factory”.

At no point during this process have I needed to prove I am in possession of a valid TV Licence. I didn’t bother clicking on the part of the page where it says “I have a TV Licence”, I just needed the pid (Programme ID) from the URL bar.

Sony KDE P42 XS1 software update 05TV232

July 12, 2016

I found this on an old hard disk, it is the firmware update which applies to a limited range of serial numbers of this old Gas Plasma TV. See http://forums.digitalspy.co.uk/showthread.php?t=382995&page=2 for the details.

You should be able to download the disk image from http://s000.tinyupload.com/index.php?file_id=00749785744233751953.

Unzip, and write the file to a 128k Memorystick. The digitalspy forum post talks about creating folders etc, but if you use the disk image file then the folders/files will all be sorted in one operation.

I had one of these TVs a while ago, and it was a good TV. I sold it because I needed multiple HDMI inputs, and using one HDMI to YUV converter turned in to too much fuss.

 

Onkyo TX-SR606: One in the eye for planned obsolescence.

June 3, 2016

Today I repaired my Onkyo TX-SR606. The video board was failing on HDMI handshaking. With a nod of thanks to patpatpat999, and others, I replaced capacitors C8609 (top) and C8002, C8602, C8096, C8162 (bottom) on the HDMI switcher board. The linked video has a good description of how to remove the board, and how to identify the components.

I used radial lead capacitors, not surface mount types. There’s enough room on the board to sit them flat in between other components. I bought 105C-rated components, as the issue seems to be heat from the power amplification part of the system.

P1020156s

If you’re feeling really keen, use a dab of hot glue to hold them in place. I’m not planning on moving the unit often, so I’ll let the capacitors flap in the breeze.

Living Streets – Try20

May 3, 2016

It has come to my attention that it is National Walking Month. I realise I might not be the target audience for this (honourable) campaign, because I will actively avoid a walk which looks like it will exceed 10 minutes. I’d prefer to jump on a bike and ride for 10 mins, an hour, several hours, as long as have the time and energy for.

Ten minutes is about the break-even point for walking versus cycling for me.

I wish Living Streets the best for their efforts.

You sir, are a buffoon.

January 7, 2016

On the grounds you’ll never enforce the legislation you are suggesting, therefore it’s pointless and redundant from inception.

As a road user, on both four wheels, two wheels etc I have always felt that cycle lanes are dangerous because they bring cyclists in to potential confrontations with motorised vehicles. Given the contemporary increase in the interest in cycling there will be greater numbers of cyclists who lack the experience of joining faster-moving traffic.

My solution is so simple it’s hidden in plain sight; remove all cycle lanes so there are no points where cyclists are merging in to motorised traffic.

Therefore car drivers will have to share the roads, as they are obliged to do so. Similarly, cyclists will have to share the road, and because there are more of them now that task will be made easier.