torsdag 1. november 2018

stepper motor microstepping vs current.

I had a problem with missed steps on my CNC, as far as I can see it relates to the motor drive current. Higher current more lost steps and vice versa.

mandag 20. august 2018

Google Sketchup over RDP problem SOLVED

How to make Google Sketchup work over RDP (Remote Desktop).
I have had problems launching sketchup over RDP session, it throws this error:

If Sketchup has been started locally before using RDP it works fine, sometimes is crashes but most of the time it's ok.

I googled and came up with a smart solution:

- Create a Batch file which includes the following two lines:

tscon 1 /dest:console
"C:\Program Files\SketchUp\SketchUp 2017\SketchUp.exe"
- Run the batchfile as administrator (this will diconnect your current remote desktop session)
- Wait the time sketchup normally takes to start before you reconnect the remote desktop. If you reconnect too quickly you will get the OpenGL error.

I also found that you have to disable the startup screen so the sketchup will launch directly into editing mode.

You can also add a path and filename to a SKP file after the .exe line in the batchfile to load a project automatically.

BTW: This assumes that you are using session 1 on the computer.

mandag 13. august 2018

Mach3 stepper motor problem

Had a problem after testing mach3 for the first time, could not get the stepper motors to move as expected. Only stuttering av vibrating unevenly, did an extensive google search round but I did find any solution for my problem.

I did everything like, switching from WinXP ACPI to standard installation, tried Windows 7 32 bit, nothing helped. tried Other drivers and other motors.


My solutions was enable STEP LOW ACTIVE, that did the trick. The motors are running smooth as silk now.

BTW: I'm currently running a USB breakout board called Novusun NVUM_SK. el cheapo china card. Seems to work fine until now, have read somewhere about some incompability with mach3. I don't know, we'll see.

link to my breakout card, where you can also find the driver plugin for mach3. The card did not kcome with any software included when I bought it at ebay.

fredag 13. april 2018

Google Spreadsheet importDATA error.

I've been struggling with the IMPORTDATA function in Google Spreadsheet to import CSV data, everything seems to work normally the first time I load the file, but after a while I get NA and error in the spreadsheet, and of course the data is removed from the sheet.

I did read somwhere that the problem may be related to caching of data, I do not know if the problem is local cache or remote cache at google servers.

I found a solution which seems to work better than others, it may not work in your case but try it.

The normal way I add the IMPORTDATA formula is as follows:

=IMPORTDATA("http://www.data.com/testdata")
this fails, the solution I foudn was to add IFERROR and repeat the IMPORTDATA and adding trailing slashes to the URL. Trailing slashes does not seem to alter the url at all (may be a problem if you link directly to a CSV file, I'm using url_rewrite on my webserver), it seems to trick the cache problem. For now I'm using this formula with two nested IFERRORs:

=IFERROR(IMPORTDATA("http://www.data.com/testdata/");IFERROR(IMPORTDATA("http://www.data.com/testdata//");IMPORTDATA("http://www.data.com/testdata///"))) 

You can add more IFERRORS as well with even more trailing slashes.

fredag 3. oktober 2014

HOWTO use SSH and PuTTY as SOCKS proxy server for secure surfing on public wifi

I've been looking around for different solutions to secure my wlan connection when traveling, lots of hotels are only using open wifi networks and that's a BIG security flaw.
This solution may also work for bypassing webfilters a work, if you want to surf on websites not allowed by your employer this will help you. (but I'm not liable for any damage you cause your employers network/computers or if you get fired for doing this :) ).

After trying several solutions I came across a blogpost about using a SSH connection as a secure proxy server for whatever software you're using. But I had problems getting it to work, I found only poor guides on how to do it. So here I will try to make a better one.

I'm running windows 8 on my laptop so I will be demonstrating this using PuTTYwhich is a SSH client for Windows. Google it.

The only thing you need for this to work is access to a SSH server, this can be your webhost, home server or whatever.


  • First you need to download PyTTY. Download
  • When you start PyTTY you will see the window below, here you fill in your SSH server hostname, port and choose SSH. (shown with red circles)


  • When you have entered your hostname and port you click on SSH on the category list on the left, and then choose Tunnels.
  • A new configuration page will come into view, identical to the image below. Fill in the following information:
    Source Port (the port you want the proxy to run on, normally 8080)
    Destination (it's the same hostname and port as on the first config page but with a colon between hostname and port number)
    Choose Dynamic just below destination 




  • Click Add to add the configuration for this connection. You should now see a number in the text field above. See image below.



  • You're now finished with your configuration, click open to start the SSH session and log in normally using your username and password at the SSH server.


After finishing the PyTTY configuration you'll also need to add the Proxy server to your browser, In firefox, go to settings, network and choose connection settings.
Here you'll choose manual settings and in the SOCKS field you write localhost and in port you write 8080 (same we set in the PuTTY configuration earlier).
It does not matter if the SOCKS setting is on SOCKS4 or SOCKS5.
Click OK and you're done.

You are now surfing with the SSH serves IP adress as the visible one, go to whatismyip.com to verify your public IP adress.

mandag 8. september 2014

ADS-B reception with RTL SDR dongle and home made collinear coax antenna.

I figured out I wanted to try ADS-B reception with my dustcollecting dongle, and how could I know how much fun that was. The range out of the box was pretty impressive (and I will make a comparison chart later), but I wanted to build a better one. The one I decided to build was a collinear coax antenna. I used cheap RG-6U coax cable with eight segments and a 75 ohm resistor on top. Incredibly easy an quick to build and as far as I can see very efficient. I use windows software RTL1090, and save data into a MySQL database via a PHP script on my server.


This is my reception map, I'm very impressed that with an indoor antenna I'm able to reach at least north-west 150 NM  out to sea. Of course the antenna is mounted on the wall in the north-west corner of my house, and I've got very few obstacles in the vicnity in that direction. Aircraft need to be at cruising altitude as well ~30-40000 feet. The map is created by a tool called SBSplotter, see http://sonicgoose.com/superimpose-polar-plot-in-google-earth/ for more information.

Hopefully I will be building a 12 segment antenna to test later, that will be fun.


Here you can see all ADS-B tracks I've collected for about 20 hours today. 

See http://www.balarad.net/ for detailed instructions on how to build the antenna.


tirsdag 8. april 2014

HOWTO Start Dante Socks server together with OpenVPN client during reboot in Ubuntu 12.04

After installing Dante SOCKS server it would not start during reboot, thee problem was the OpenVPN tun0 interface was not up when dante was starting, and it would not start with error tun0 not found.

I did quite a bit of googling before a solution came to me, i did find it on the page: Turn your Raspberry Pi into a VPN gateway.

Here is a overview of the solution (slightly modified for the original):

First remove the normal start and stop hooks in rc*.d
sudo update-rc.d danted remove
Next create the scripts.
sudo mkdir /etc/dante_scripts
sudo nano /etc/dante_scripts/myprovider.up
Add the following contents to /etc/dante_scripts/myprovider.up:
#!/bin/bash
if [ "$1" = tun0 ]; then
 /etc/init.d/danted start
fi
sudo nano /etc/dante_scripts/myprovider.down
Add the following contents to /etc/dante_scripts/myprovider.down:
#!/bin/bash
if [ "$1" = tun0 ]; then
 /etc/init.d/danted stop
fi
Make the scripts runnable:
sudo chmod +x /etv/dante_scripts/*
Add the hooks to /etc/default/openvpn:
sudo nano /etc/default/openvpn
Modify the OPTARGS:
OPTARGS="--up /etc/dante_scripts/myprovider.up --down /etc/dante_scripts/myprovider.down"