Network connected USB

Why

So my car records the last 60 minutes from multiple cameras to a USB stick if you plug one in. I want to do something more long term like take a snapshot every 5 mins when driving. Sowhen COVID eventually goes away I can get a time lapse for each road trip I do. I’ll probably have it generate automatically, but needing to have a sanity you may publish check from me.

Hardware

I was doing some reading and I came across the TeslaUSB project on reading about this I discovered that the Pi Zero and Pi 4 can be used as USB gadgets. (It’s all to do with how the USB is set up on the boards that only these options will work). So I got a Raspberry Pi 4 and m.2 SSD drive and an enclosure for it.

Software

First I put Raspberry Pi OS Lite onto my Pi my sdcard then added the ssh flag file so I could workout it’s IP and connect to it over a wired network connection, from that connection I set the Pi up for the home wifi and then gave that a static IP address in the router’s interface.

Next I added my m.2 USB enclosure to the Pi and got that mounted as /data then added to fstab as I always want my data drive mounted.

Loop devices

Damn I learnt a lot about how not to do it here. To create a file system in a file is really easy, but to get it so both Windows and Linux accept the same file system is where I really struggled.

sudo fallocate -l 100GB /data/piusb.bin
sudo mkdosfs /data/piusb.bin -F 32 -I

From fstab I have this mounted readonly so I can get my data off to process on a read write file system without confusing the car as it should have sole access to a USB stick that is plugged into it.

/data/piusb.bin /mnt/usb_share vfat auto,user,ro,umask=000,offset=1048576 0 0

We present the same file to the USB gadget in rc.local (lazy start up script)

/bin/sleep 5
/sbin/modprobe g_mass_storage file=/data/piusb.bin stall=0

As the car is expecting a device with partition table and partition we don’t need to worry about the offset for that, but without working out what the offset should be I couldn’t see the data on the read only filesystem so couldn’t copy it off.

pi@raspberrypi:~ $ sudo fdisk -lu /data/piusb.bin
Disk /data/piusb.bin: 32 GiB, 34359738368 bytes, 67108864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xfe02295c

Device           Boot Start      End  Sectors Size Id Type
/data/piusb.bin1       2048 67108863 67106816  32G  c W95 FAT32 (LBA)

And 2048 x 512 = 1,048,576 which is the number you might recognise from the fstab line offset.

I did consider pulling the video off to process on a device not in the car, but I’m not going to add a access point just for the car and transfers happen at about 300 KB/s so I think it makes more sense to make my time lapse images in the car then upload the images for rejoining to a video outside the car.

What else could I do with this

Some equipment writes it’s log or image files to USB. By using the same approach (probably with a better wifi connection that in a glovebox in a metal cage of a car). It would be possible to get data off this kind of device and onto machines able to process it faster.

Gout?

Oh f*%#

Is how I can describe waking up on Thursday morning. If I touched my big toe on my right foot then I wanted to scream and I just couldn’t put a sock on and my toe wouldn’t move if I moved the others it was stuck frozen solid.

So I went along to open surgery at my GP practice who queried gout and then due to my asthma / blood pressure medicines chose to put me on a drug that comes with a warning “DRUG TOXICITY WARNING: High doses of Colchicine can result in drug toxicity.” It then goes on to say you can’t start a second course for three days. I also got told to stay off the ibuprofen with my asthma. The doctor did say when she first saw me that the blood tests for Urate (Uric Acid) normally peak six weeks after an attack. So when they got the blood test results back and called me about them she was able to say that all the numbers were normal (including Urate being normal, but on the high side of normal) which made me glad nothing else was seeming to be wrong with me.

I’m very lucky with my doctors being able to go to open surgery and get seen the same day makes me glad I have the GPs I do. I was even more pleasantly surprised when I got called about my blood test results and didn’t need to phone up myself.

Is it getting better?

Well I can move my big toe a whole millimetre now, but I really needed a hair cut so off to the hairdressers I went with sandals and a sock just on my good (left) foot. Yes I felt and looked stupid, but there was no way I could get a sock on and not scream the house down and my sandals seem to just miss the sore area, but even so I was so glad to get home and get the damn think off my right foot.

As you do when you’ve been told what a problem most likely is I was looking up diet advice on the internet and found this about whisky.

What’s really annoying is I had to cancel too personal training type gym sessions as I couldn’t go to work due to the toe and it’s still not moving 🙁

I just want it to work again

So my various internet reading suggests a typical attack lasts between three and ten days. So if Thursday was day one, then Saturday (today) is day three and there’s now starting to be hope it will bugger off and i can stop building towel mountains to try to help.

I really can’t moan too much, as it’s not the end of the world it’s just a bit of pain and inconvenience, but alas not something I was planning for.

Doesn’t help my mood that this weekend should have been the start of the F1 season, and I’ve been looking forward to that to have coronavirus take that away from us. That said I think the comment that explains it best is if anyone of these measures saves just one life it will have all been worth it, but at the same time it is also fair to accept these enforced changes of plan aren’t the best for everyone’s mental health and we should take extra special care to look after each other.

Tough Mudder Clapham Common

Early get up

First train on a Saturday to change at London Bridge for the Northern Line to Clapham South meant I couldn’t stay out too long on Friday.

I also found it quite hard not to get off the tube at Clapham Common, but the maps all agreed that Clapham South was the right station.

MVPing

First I gave a hand checking in the other volunteers. With a bit of multitasking craziness fortunately the 5km Tough Mudders use less MVPs than a full event weekend so I coped without the normal gang helping me.

Spread Eagle

Spread Eagle was the obstacle I was based at all day. The main challenge looking after this one is first convincing people not to go one at a time, but once that challenge is sorted it then becomes a challenge of controlling the number of people at a time isn’t too high.

It also needed a little bit of care from the construction team during the day and that gave the fun of shutting half at a time and managing the queue caused as we did so.

Second time round we had a great group at the front who were happy to use it as a reason for a rest and have a good chin wag about nothing in particular.

So in general I had a great day out.

Once the last participants were through my obstacle it was time to dismantle the bunting round it then the course marking along from it.

Finally it was help pack down the main village. I’m slowly getting the hang of the pop up gazebos TM like to use.

Sore feet

I spend a lot of my working life sitting down and the area I was standing on was fairly well compacted ground and my feet were sure telling me about this once I was home on Saturday and all day Sunday, but now it is Monday they have recovered ready for work. Which is damn useful as we expect this to be the busiest week of the year for me and my team.

Fireman Sam

So Sunday I had an interesting start to my day.

I was helping at a local half marathon and walked to my marshalling spot getting there nice and early just in case.

A lady nothing to do with the event came up to me in a major panic as she had locked her child in her car along with her car keys.

Nothing I could do so called 999 and asked for the fire brigade. Who turned up very quickly and provided much reassurance to the lady and went as far as helping entertain the child through the window with holding a mobile phone against the glass.

In the end they summoned a recovery firm who came and gained access to the car.

I did also hear them suggesting they should ask for some content on the fire brigade issued tablet such that they can use that to help entertain.

Not quite how I expected marshalling a half marathon to start, but very impressed with their care for the lady and her child.

They also joined in encouraging the runners as they came past. Was a pleasure to have that fire engine crew on my corner with me.

Fame

In short

It opened last night in the West End and there are a criminal number of empty seats at very good prices!

It is at the Peacock theatre until Saturday 19th October 2019

Go and buy tickets

Seen it before

I’ve seen this production twice before as it toured the UK and it’s has not disappointed me yet. (Tunbridge Wells and New Wimbledon)

My Highlights

So there were four parts of the show that I’d call my personal highlights based on last night.

The teachers argument

Miss Sherman (Mica Paris) vs. Miss Bell (Katie Warsop) sung with such emotion you can not help but completely believe in these two characters.

Think of Meryl Streep

Serena (Molly McGuire) acts whilst singing and again really makes me connect the the character as that character learns how to connect to her emotions for acting.

These are my children

Every time I’ve seen the show this song blows me away Miss Sherman (Mica Paris) delivers this song with such power, and you cannot help but believe how much she feels she has “the privilege to teach” 

Bring on tomorrow (reprise)

Just a piano played by Schlomo (Simon Anthony) had the entire theatre in complete silence! Quite a contrast from some of the louder numbers, but done so well. (I’ll excuse the the slight equipment fan noise).

Other thoughts

The dancing needs mentioning a lot of it is such high energy. It also can not be easy dancing badly when you know how to do it well! They all inspire me to get myself back to the gym, but don’t think I’ll catch up with them.

My verdict

I can only give this show 10/10. It to me is a real feel good show (despite dealing with a drugs overdose in the storyline). When my mates are free and in London I’ll be going back!

Met one of my childhood friends who I’m still in touch with who was also watching the show, and know she shared my opinion of how good this production is! 

Finally

Who’s free to come and see it again with me?

Geeky Sunday

So today I’ve written a plug-in for x-plane 11 and it lets me control my hue lights…

This took far too long, but I’ve had to refresh my (human) memory on how to write code in C.

I’ve learnt how to compile a dll to use libcurl as the hueapi is based round http requests and sod writing that from scratch when there are free industry standard libraries waiting to be used.

But I’m proud of what I’ve got working all good exercise for the mind, the next tricky bit is making some menus as I’ve got lots of hard coding in there based round my own hue setup that won’t be too useful to other people. Although it tempting I can’t really expect people to work out the IP address of their hue bridge to type in to save me coding the find hue device code.

All because when I am flying the X-Plane commercial jets I want to be able to control the room lighting based off the simulation settings. Not sure if all planes implement the cocking lighting stuff, but someone has suggested that it could be linked to ambient light too (need to find where we can read this from still)

I also want to see if the code runs fast enough that some hue lamps can copy the external plane lighting that flashes, but if it slows down too much I’ll scrap that idea.

This train is formed of eight coaches

As I was late to bed last night I allowed myself the luxury of getting the 08:39 instead of my normal 07:36 train to work.

I don’t understand people the announcement repeatedly says “this train is formed of eight coaches” yet a good number of them walk well past the “8 car stop” sign and then look surprised the train has stopped before them on the platform.

Maybe it is not obvious what an “eight car stop” sign on the bank of screens for the driver to check the doors means.

We had our summer support services staff party last night, for a change I only had one drink and am feeling very smug on the lack of hangover I would normally have.

Joseph and the Amazing Technicolor Dreamcoat

Sorry for the delay in posting, but my mind has been a fog thanks to antihistamine following a few insect bites. (You can read about that here)

So Monday night saw a me go with some of my family to see Joseph at the London Palladium.

Having seen this before when I was still at school it was great to see how they have taken the production into the modern world. One such highlight being the butler being played by one of the younger female members of the company.

Sheridan Smith was amazing and still has her quirky humour which made the production a bit less sterile than the subject matter can be.

Plenty of high energy dance numbers thrown into including a can-can playing on the mishearing of “Canaan”. Still not sure if the end of Act One and “Go Go Joseph” or the “Mega Mix” at the end is my favourite part of the show. Maybe this is my excuse to go again…

A very impressive custom lift / trap door setup is used in the centre of the stage, didn’t notice the sound or lighting much otherwise which to me implies it was all done well. If you’re not tall front row of the Grand Circle is a good place to sit in this theatre and at only £15 a ticket, can’t quite believe my luck.

Get back on track

So it’s time to get back on track. Having to buy the largest waist jeans M & S sell is never a good plan, which when I did lose weight I promised I’d never put it back, but alas I failed there. Time has come to fix this.

I’ve ordered some new swimming goggles (with prescription lenses, hence the not buying on the high street). My swimming kit is already sitting under my desk as work so once they turn up we’re ready to rock and roll. I really need to start rolling as Kat suggest we do London Tri 2020, currently I’m not going to be able to get anywhere near to getting my wet suit on.

I’m also going to have a go with Huel, but in reality I’ve got the nutrition right if (and it’s a very big if) I can stop myself from snacking. Now it was competition with Kat that worked for me last time the weight came off, so hopefully I can make this work all over again.

As a Tough Mudder Brand Ambassador it would be good to be able to run more of the course, but then I do also love my volunteer shifts with Tough Mudder. I have to include any first timers wanting 30% off use BRANDUK9353 as a discount code to sign up.

Anyway the plan is as for next week to be swimming three times a week, before upping this to some none swimming exercise.