søndag 7. mai 2023

Visual Studio code replace curly braces with brackets (PHP)

To replace curly braces with brackets using search and replace in Visual Studio code for PHP use this search/replace pattern: 

Enable regex search.

Example:

$image{0} to $image[0]

 

Search: (\$[a-z]+)\{(.)\} 

Replace: $1[$2]


 

søndag 2. mai 2021

PI24 + RTL-AIS

  1. Burn PI24 to SDcard
  2. boot and setup wpa_supplicant and raspi_config if applicable
  3. setup FR24 and it working
  4. install giut and build-essentials
  5. install dependencies, not librtlsdr-dev if you are compiling your own version to get rid of errors see below.
  6. git clonw rtl_ais and compile
    https://pysselilivet.blogspot.com/2020/05/ais-reciever-for-raspberry-pi-2-channel.html
  7. keep rtl-sdr units always connected to the same USB ports on the RPi and use device index parameters to point which unit to which software

    Compiling custom librtlsdr-dev

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.