Tips & Tricks Blog
Notes, ideas and general comments on anything related to high-tech.

November 28, 2020

Converting Old UPS to Power Control Box

Filed under: Uncategorized

This simple contraption was quickly put together a few years ago to allow remote power control over WiFi or USB dongle. It can be set up to work as a WiFi access point serving its own SSID or as a client connecting to an existent WiFi network. In order to control the power one has to connect over ssh. When connected a simple menu is presented for configuring the device or powering the outlets on or off.
Entering “s” (undocumented) while in the top level menu drops you into the shell.
Note: initially I had USB dongle connected permanently, but it was causing the board to drop into the bootloader prompt on boot when powered up without a PC connected.

The hardware:

It was made with old CyberPower 425VA plus Olinuxino A13 WiFi with relays module.
The power is fed to Olinuxino directly from the battery feeds. The battery is stored outside and connected to the red and blue terminals.
The outlets were rewired to be powered through the Olinuxino controlled relays.

The software:

Start with the pre-built image from here:
https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/A13-build/A13_olinuxino_Debian_kernel_3.4.90%2B_image_description.txt

The image file name is:
A13_debian_34_90_WIFI_RALINK_GCC_GPIO_X_I2C_100KHz_UVC_TS_FTDI_3G_video_accell_release_10.img
It’s big (almost 4GB), so torrenting it is the best option.

I’ll keep a copy on google drive till need to free up space:
https://drive.google.com/file/d/1DzbFk9hplX51KZCa82LuA3gB7mFvIfCW

The more detailed image flashing instructions are here:
https://www.olimex.com/wiki/Prebuilt_SD_card_images_running_debian

Install hostapd and dnsmasq:
https://www.olimex.com/forum/index.php?topic=1635.0

Pull (using GIT) or download and extract files from the repo (URL below) into “/ups” folder on the board:
https://github.com/dob71/olinuxino-powerctl

Set up the init script:
ln -s /ups/init.d/powerctl /etc/init.d/powerctl
/usr/sbin/update-rc.d powerctl defaults

Add user “admin” and set /usb/control as its shell in /etc/passwd.

Edit /etc/inittab to respawn getty with admin login instead of root on ttyS0
T0:2345:respawn:/sbin/getty -L -a admin ttyS0 115200 linux

Example session (the control board is in client mode connected to home WiFi):

$ ssh admin@192.168.1.152
Warning: Permanently added '192.168.1.152' (ECDSA) to the list of known hosts.
admin@192.168.1.152's password:
Linux a13-OLinuXino 3.4.90+ #1 PREEMPT Thu Jun 19 09:51:45 EEST 2014 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Nov 28 02:30:35 2020 from some.host.okob.net
Please press a key:
'w' - control WiFi, 'p' - control power, 'r'- admin password.
The system is in STA mode
Wireless device state:
wlan12    Link encap:Ethernet  HWaddr 48:02:2a:ea:11:1f
          inet addr:192.168.1.152  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:854 errors:0 dropped:4329 overruns:0 frame:0
          TX packets:251 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:173505 (169.4 KiB)  TX bytes:39336 (38.4 KiB)
'c' - client mode, 'a' - AP mode, 'e' - exit:
'w' - control WiFi, 'p' - control power, 'r'- admin password.
Current power state:
R1(surge outlet 1) : on
R2(surge outlet 2) : on
R3(surge outlet 3) : on
R4(battery outlets): on
1-4 toggle the state, 'u' - all on, 'd' - all off, 'e' - exit:
Current power state:
R1(surge outlet 1) : off
R2(surge outlet 2) : off
R3(surge outlet 3) : off
R4(battery outlets): off
1-4 toggle the state, 'u' - all on, 'd' - all off, 'e' - exit:
Current power state:
R1(surge outlet 1) : on
R2(surge outlet 2) : on
R3(surge outlet 3) : on
R4(battery outlets): on
1-4 toggle the state, 'u' - all on, 'd' - all off, 'e' - exit:
Current power state:
R1(surge outlet 1) : off
R2(surge outlet 2) : off
R3(surge outlet 3) : off
R4(battery outlets): off
1-4 toggle the state, 'u' - all on, 'd' - all off, 'e' - exit:
Current power state:
R1(surge outlet 1) : on
R2(surge outlet 2) : off
R3(surge outlet 3) : off
R4(battery outlets): off
1-4 toggle the state, 'u' - all on, 'd' - all off, 'e' - exit:
Current power state:
R1(surge outlet 1) : on
R2(surge outlet 2) : on
R3(surge outlet 3) : off
R4(battery outlets): off
1-4 toggle the state, 'u' - all on, 'd' - all off, 'e' - exit:
Current power state:
R1(surge outlet 1) : on
R2(surge outlet 2) : on
R3(surge outlet 3) : on
R4(battery outlets): off
1-4 toggle the state, 'u' - all on, 'd' - all off, 'e' - exit:
Current power state:
R1(surge outlet 1) : on
R2(surge outlet 2) : on
R3(surge outlet 3) : on
R4(battery outlets): on
1-4 toggle the state, 'u' - all on, 'd' - all off, 'e' - exit:
'w' - control WiFi, 'p' - control power, 'r'- admin password.
Connection to 192.168.1.152 closed.

November 27, 2020

CyberPower PowerPanel Personal Edition Settings

Filed under: Uncategorized

I retrofitted a couple old UPS boxes with external battery packs that provide more runtime, but I do not trust those UPS devices to calculate the remaining charge to decide when it’s time to shut down. I needed to set explicitly how much time I want the system to run on the battery power till it shuts itself down. Unfortunately, the UI does not allow to set that value to be outside of a small hardcoded range, however…
As of today CyberPower uses MySQL to store the setting. The screenshot below shows where the DB is stored on Windows 7 x64 machine and the field to tweak. Note, that the UI uses a drop down selection box, so it’s not going to show that value. Any change made through the UI is going to update it in the DB.

cyberpower_powerpanel_personal_settings_db

August 8, 2020

First hand experience with Samsung Galaxy S9 battery getting on fire…

Filed under: General — Tags: , , , ,

Wow, that was exciting…
My Samsung S9 battery bloated up popping the back cover open. I bought a replacement and was in the process of changing it when the old (bloated one) shorted somewhere inside in the bottom corner of the battery. It started by glowing in one small point then the whole thing started sizzling making lots of smoke. I tried to take it outside but made only a few steps before the whole thing got hot and scary to hold in hands, and I had to drop the phone. The battery remains popped out and started glowing red (I’m not exaggerating) then caught fire. Fortunately that main burning piece of the battery landed on the concrete part of the floor. The pieces that landed on the carpet were so hot that they melted it. Those were not thick big pieces that can absorb a lot of heat, pretty much just a copper foil (I guess with a bit of still reacting lithium).

The tip of the day: BE VERY CAREFUL PRYING OUT LI-ION BATTERIES, ESPECIALLY AVOID THE CORNERS.

Surprisingly, the phone still works, just the speaker board needs replacement…
And as I recently noticed there is now a yellow tint in a few places where LCD was damaged by the heat.

December 15, 2018

Printing Alloy 910 from taulman3d.com

Filed under: 3D Printing

For my first experimental print the nozzle temperature was 250C. That appeared to be the right temperature for printing, but a bit too high for the hotend. It looked like decreasing the temperature a little was possible. The further experiments proved that printing it at 245C works perfectly fine.

The bed was at 60C and covered by PVA. The attempts to print on clean glass at 75C and 90C were not successful.

The filament behavior appears to be similar to PLA. There’s leaking and fan is likely to be needed for printing small details. In the print pictured below the fan was always on at 30% (mostly because I was hoping it will help to keep the upper part of the hotend from overheating).

alloy910smallparts

After making a few more prints the conclusion is that 50mm/s is too fast for this filament and my Makergear hotends. There was obvious insufficient extrusion of the filament in the infill  printed at 50mm/s regardless of fan being turned on or off and regardless of the printing temperature being increased or decreased 5C. Printing everything at the constant speed of 30mm/s immediately improved the results.

The print on the left picture is done at 50mm/s infill, the right at 30mm/s.

20181216_225311 20181216_232040

December 2, 2018

Printing T-glase clear filament

Filed under: 3D Printing

The material prints nicely. It flows and leaves strings like PLA though (perhaps increasing retraction a bit will help).

I used the same slicer settings as for their (http://taulman3d.com) Nvent filament (didn’t play with any settings to make it more transparent). The extruder was at 245C although I think it could be at a bit lower (240-243 C) temperature to help with stringing. The bed was at 75. For small objects (20 x 20 x 10 mm calibration piece) it worked fine with Elmer’s glue, but the large pieces didn’t stick well enough till printed on the clear glass. I had no troubles removing those large pieces after cooling down (they pretty much got loose on their own).

t-glase-printing 20181202_011456

P.S. I forgot to note what was the fan setting and cannot remember it now (I think I kept it off).

October 4, 2018

How Much Lead Can You Get From a Car Battery

Filed under: General

Long story short, I needed to source about 20lb of lead cheaply and decided to take apart an old car-sized marine battery a friend gave me.

If you ever do that (and my advice don’t) just get the contact points and the big chunks that bridge the plates. You can see the latter on the picture inside the battery case.

Getting the lead mesh from the plates is not worth the efforts. There is more junk there than lead.

Baking soda and/or pool’s PH+ chemicals can be used to neutralize it. Borax can be used too. It converts it into boric acid and anhydrous sodium sulfate (neither of which is a nasty stuff, apparently). The process is simple. First, the water is added to dilute the acid (it’s not pure, so 50/50 mix is good enough). Then the neutralizing agent is added slowly (if doing it start with one spoon to see how it reacts). The baking soda and HTH PH+ bubble when added (borax doesn’t). As soon as it stops bubbling when the baking soda or HTH PH+ is added it should be good to dispose of.

It took quite a bit of the stuff to neutralize all the acid in the bucket and its remains in the battery case. I have scavenged and dumped in a pound or two all the above chemicals till it finally stopped bubbling.

20180915_160845 20180915_160854 20180916_3

The final result: 10lb

20180916_144331

And after smelting there were only about 6lb left.

The conclusion: a lot of time, efforts and baking soda wasted (borax and PH+ did not count, didn’t need them anyway).

Water Purity Experiment

Filed under: Water

Just for the fun of it I decided to see how different is the residue after evaporating the water coming directly from the well, vs passed through the softener, vs passed through the reverse osmosis filter (iSpring under-the-sink system).

I have filled in 3 glasses, covered them with a napkin and left to evaporate slowly in a secluded corner in the basement.

To my surprise it took a while (about 2-3 months, probably due to high humidity in the basement in the summer).

Here are the results (left-to-right: well, softener, filter). The last row is under microscope (4x magnification):
20181003_231623 20181003_231630
20181003_231638 20181003_231642 20181003_231645
20181003_232125 20181003_23214420181003_232213
20181003_234106 20181003_234326 20181003_234424

The filter has (quote) “… Alkaline mineralization filter cartridge with Mineral Stone, Calcite, and Corosex …”. The content inside is of brown/yellow color, so I guess that’s where the brown crystals come from.

June 26, 2018

Printing with Taulman n-vent from LulzBot

Filed under: 3D Printing

The n-vent filament works well for the large items (like boxes). The 3mm blue roll I’ve got from LulzBot printed nicely at 237C hotend and 75C printing bed temperatures. The bed was a glass plate coated with Elmer’s glue. There’s only Slic3r profile for n-vent in https://github.com/dob71/x2sw_profiles

20180626_211944

June 4, 2018

Microsoft OneNote Sign In Fix

Filed under: Web, Windows

After installing the OneNote 2016 PC client it asks you to sign in to the cloud.
If it decides that you have to use a business account (i.e. you are trying to set it up on a PC that is a part of a domain), but you need to use your personal account it is going to complain. It will either say that your email address’ domain isn’t known, your account does not exist/not found or it doesn’t look like work or school e-mail.

The following registry change will make it accept a personal account. First exit OneNote app, then change the value in the HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\OneNote\FirstBootStatus key to hexadecimal 2000202.

March 4, 2017

ESXi 6.5 and Ubuntu clipboard

Filed under: ESXi, Linux

Every time I have to set up new ESXi and add Ubuntu machine templates I’m getting into the same troubles, now writing it down to remember…
VmWare tools and clipboard are not working in Ubuntu desktop, so for the recent Ubuntu versions (14.xx, 16.xx):

1. In the ESXi host add the last 2 lines to the config and reboot:
[root@esxi1:~] cat /etc/vmware/config
libdir = “/usr/lib/vmware”
authd.proxy.nfc = “vmware-hostd:ha-nfc”
authd.proxy.nfcssl = “vmware-hostd:ha-nfcssl”
authd.proxy.vpxa-nfcssl = “vmware-vpxa:vpxa-nfcssl”
authd.proxy.vpxa-nfc = “vmware-vpxa:vpxa-nfc”
authd.fullpath = “/sbin/authd”
isolation.tools.copy.disable=”FALSE”
isolation.tools.paste.disable=”FALSE”

2. In the Ubuntu guest instead of installing the tools bundled with ESXi:
sudo apt-get install open-vm-tools-desktop

Older Posts »


Home

OkOb.net Tips & Tricks Blog
Powered by WordPress