Wednesday, 10 May 2017

Storage closet 5c

passcode: 1721
5C notice board: orsyr ii
5C exit code: 2954

Tuesday, 2 May 2017

How to repair stuff

No literally, things break, fact of life. Fixing stuff is the only way to keep 2 very useful things in life. Junk out of the landfill and cash in your pocket.

So 2 tips:

  1. Sugru substitute:
  2. Superglue (UK only)

The Hafix postage costs are high, so order the 20 gms bottle.

I went over to the local landfill this weekend, with 2 bootloads of cleared out garden rubble and excess bin waste. It feels a real shame that we throw so much stuff into landfills. Even the stuff that is sorted at the recycling centre is still really inefficient. So I feel sad about all of the waste, but there you have it.

Friday, 3 March 2017

Weighing a LPG gas bottle

Okay , so we have 47kg bottles - now, lp gas cannot be measured using pressure

So I'm going to use 2 load cells in  bridge to get the mass of a bottle. Each cell is good for 50KB, but in a bridge, and add 2 pairs (4 cells) it really gives you 100Kg, since weight is distributed across the cells - you just have to average (add) them.

Vbus and 485

The other part besides a load of sensors to gather and log data for is the water heating system. It's Resol VBUS based. 

A Circuit diagram
RESOL Circuit Diagram v3

A full converter with usb is available here: price unknown. I sent off a query to get a price anyway.

One thing is that the solar controller unit is obviously not isolated from the power supply, something you will want to do for any equipment which is connected (at least by proximity) to water pipes, and to your roof in event of god ever getting unhappy with you and sending a bolt down. Nearby strikes also cause problems for piping anyway. So with a bit of searching, it appears that the bus supplies 35 ma (or 65 on newer devices) constant current. They appear to use this to drive a LCD remote display in one instance I believe, but not sure. anyways, it got me thinking that an opto isolator (which needs about 10mA) will work here if we power our converter from the line current. The LM339 uses almost no juice nor does our circuit. And the 5.5V signal sent on the master drops to around 4.5V due to our rectifier. which will still run our converter circuit, but may require a transistor on the Raspberry Pi side to clean up if needed, although I'm going to try without a transistor first.

Aha - just read the spec doc, the end of the doc contains a diagram supporting my assertion that you can use an opto coupled circuit to get galvanic isolation powered off of the line. Using a 5.1v zener; just add an extra rectifier diode to pump the supply which is fed through a 330 ohm resistor to prevent the power supply killing the data line, and smoothed off into a 470uF cap. (100nf ripple ceramic needed as usual.)

Saturday, 31 December 2016

Multiplayer dedicated server setup notes

To start off, use this guide

Some notes also here

I am moderating for a server, more details here, but this page is for learning how it all works.
The shortlink to the challenge infos is


Copied dedicated.yml to server.yaml file and changed:

    Srv_Name: Masperon Challenge
    Srv_Password: xxxxxxx
    Srv_MaxPlayers: 4

    Srv_Description: "Post here [url=]Masperon Challenge[/url] to get a password."

    Srv_StopPeriod: 12

    Tel_Enabled: true   # Activate Telnet server
    Tel_Port: 30004
    Tel_Pwd: xxxxx

    MaxAllowedSizeClass: 5

    Seed: 470786         # The seed determines how the world is procedurally generated - the same seed means the same world

    DiffEscapePodContent: Hard        # Easy, Medium, Hard --- Determines the content of the Escape Pod when you crash land on the planet
    DiffAmountOfOre: Poor             # Rich, Normal, Poor --- Influences the average amount of ore that a deposit contains
    DiffNumberOfDeposits: Few        # Plenty, Normal, Few --- Influences the average number of deposits per planet
    DiffDroneBaseAttack: Hard         # Easy, Medium, Hard, Off --- Influences the difficulty of the drone base attacks (infinite waves, number of waves etc.)
    DiffDronePresence: High           # Low, Normal, High, Off --- Influences the overall number of drones that are present on a planet    DiffConstrCraftTime: Normal         # Faster, Normal, Slower --- Influences the overall craft speed of constructors

The part I'm struggling with next is telnet connection port 30004. For some reason I had to kill the EmpyrionDedicated process and start the server again before it starts to listen on port 30004

I made my server name "Masperon Challenge", but it's not in the server browser even though I can connect locally.

Saturday, 10 December 2016

Empyrion Galactic Survival blueprint swapper

I wrote a little script to swap blueprints from BA to CV. Sometimes you design a base as a CV, then at the end you spawn your artwork in space and too late realise that in order for a CV to land on it in space it has to be a BA, whoops. So I wrote a script to swap the BP types around.

This standalone script does not require anything else to download so long as you are running a Fully updated Windows 7 or Newer Windows. It runs native in Windows without any binaries. Before I share the script, here are the instructions:
1. Type "powershell" in the start menu
2. When it comes up, select run as Administrator.
3. Go to the folder you saved this file to and type as below:

4. Just run the script, it will find your blueprint folder (unless you installed steam on another drive to c:\ or 2 people play EGS on this computer, then it will error. If this happens, send me a message.)

Download the script here:
# If you see an error:
#     .\Toggle-Blueprint.ps1 : File Toggle-Blueprint.ps1 cannot be loaded. The
#     file Toggle-Blueprint.ps1 is not digitally signed. You cannot run this
#     script on the current system. For more information about running scripts and setting execution policy, see
#     about_Execution_Policies at
# Then open powershell using RunAs Administrator, and type in
# PS:\> set-executionpolicy Bypass
# Converts a CV to a BA blueprint or back (or HV to a SV)
# Optionally provide the name of a blueprint (without the file extension)
# Will not overwrite an existing BP
# Help: 
Param($inputFile="", $outputFile="", [switch]$flatten)
Set-strictmode -version 2
$erroractionpreference = 'stop' 

$basePath = @(ls 'C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Galactic Survival\Saves\Blueprints' -recurse -include '')[0] | split-path -parent
if ([string]::Isnullorempty($inputFile)) {
 $list = ls $basePath -exclude ''
 foreach ($file in $list) {
  $fname = join-path $file.fullname ($ + '.epb')
  write-host "$i $($ [$((get-item $fname).length)]" -foregroundcolor cyan
 $inputfile = $list[ (Read-host "choice?") ].name
if ([string]::Isnullorempty($outputFile)) {
 $outputFile = $inputfile +'(1)'
Write-host "Loading: $inputfile"

$fname = join-path (join-path $basepath  $inputfile) ($inputfile + '.epb')
$bytes = [System.IO.File]::ReadAllBytes($fname)
# read some basic stats
$newClass = 0
$entityClass = switch ($bytes[8]) { # (0x02 = BA, 0x04 = SV, 0x08 = CV, 0x10 = HV)
 16 {$msg = 'HV to SV?'; 'HV'; $newClass=4}
 4  {$msg = 'SV to HV?'; 'SV'; $newClass=16}
 8  {$msg = 'CV to BA?'; 'CV'; $newClass=2}
 2  {$msg = 'BA to CV?'; 'BA'; $newClass=8}
 default {'unknown'}
$entityWidth = [bitconverter]::ToInt16( $Bytes,9)
$entityHeight = [bitconverter]::ToInt16( $Bytes,13)
$entityDepth = [bitconverter]::ToInt16( $Bytes,17)
$terrainFlag = $bytes[33];
0..40 | %{write-verbose "$_ $($bytes[$_])"}
write-host "type [Width, Height, Depth] Flatten"
write-host "$entityclass   [   $entityWidth,     $entityHeight,    $entityDepth]      $terrainFlag"
if (($flatten) -and ($entityClass -eq 'BA')) {
 # todo make it a toggle
 $msg = "Flatten Terrain? ($terrainFlag)" 
 write-warning "The flatten terrain option does not always work, test it a few times before sharing the results"
} else {
 $msg = "Convert " + $msg
$ans = Read-Host $msg
if (('Y' -eq $ans.ToUpper()) -and (($newClass) -or ($flatten))) {
 if ('Y' -eq (Read-Host "Are you sure?").ToUpper()) {
  if (($flatten) -and ($entityClass -eq 'BA')) {
   # todo make it a toggle
   $bytes[4] = 1
   $bytes[33] = 1
  } else {
   $bytes[8] = $newClass
  $newProjectName = $outputFile
  mkdir (join-path $basePath $newProjectName) | out-null
  $newProjectPath = join-path (join-path $basePath $newProjectName) ($newProjectName + '.epb')
  write-host "Saving $newProjectPath ..."
  [io.file]::WriteAllBytes($newProjectPath, $bytes)

And a clip of the script being used ( seek to 13:06 )

Multiplayer game RP - Star Wars themed Roleplay in EGS

Tiny signwriter font Chlorenuf
 Larger SW font

Tuesday, 27 September 2016

GameMaker GameFlake

Well here we are again, just doing a braindump and embarrassing anyone who happens to fins this tiny 5 kilobyte piece of the internet and read it. No, not the CIA, you! (The CIA read all blog posters, especially mine in case we happen to be sharing state secrets.)

I got Gamemaker Studio for a low low price and now we are messing around to see if I can beat my mate the Jorrus at creating a game. I am secretly hopeing that he is too busy playing Eve or Civilization 5 or just playing Space Engineers or probably more likely Elite Dangerous to be honest. But hope never paid the bills, so here goes. I'm going to save down my notes (me memory has become like a sieve.. no a small bucket) so that as I learn things, the rate at which I forget them is captured electronically instead.

The YoYo games site is pretty good and has a good reference and explains the language really well. And initially it all looks really really simple, until you start creating something. THey link to some youtube channel with a guy called Shean or is it Craig, I forget, but the clips are pretty good, other channel that is pretty goodderer still, than Shaun Spalding is the channel.

But moving pics can get you down so some good wall of text can also be found here by a Ukrainian called Vladim and goes by the blog YellowAfterLife
(catchy title)