Thursday, June 28, 2018

Fix malformed SQLite DB in Tautuli (PlexPy) server in Windows


For those running Tautuli to monitor their Plex servers, sometimes DB issues happen. After upgrading from PlexPy to Tautuli I never had a solid footing on strange issues until I found a DB error and fixed it.

I kept seeing the following error in the logs:

Can't connect to the database: database disk image is malformed

To fix this, it's pretty simple. First you will need DB Browser for SQLite. The portable app works just fine if you don't want to install anything.

(if you need a more graphical guide, look at http://wordpress.semnaitik.com/repair-sqlite-database/ where I got most this info from)

Copy the tautuli.db file out of your plexpy/tautuli directory to work on.

In DB Browser for SQLite, click Open Database.

Execute SQL (tab)

Run the following: PRAGMA integrity_check

Then click the Play button.

You will see errors if there are DB issues (if the integrity check passes, it's not DB related).

Export the DB to SQL format and leave all the default options checked.

Once the database export is complete, import the database. This will essentially "clean" it. It will take some time to import

Import the database and select a new file name/location to store it. Replace this database with your main Tautuli database and relaunch the app.


Saturday, May 19, 2018

Installing OpenIPC on WyzeCam v2 and adding to BlueIris


Wyze Cam is a fully functional $20 security camera. Out of the box, it works great.

The only problem is that there, currently, isn't a website you can go to to manage the camera or view footage. It's only available via a smartphone app.

While the app works great pushing files to the cloud and local storage, the camera doesn't utilize open standards like RTSP, so it's not compatible with Blue Iris.

That's where OpenIPC steps in. This is very new firmware so expect these steps to change quite a bit. I'll try to keep it updated. There is a subreddit dedicated to OpenIPC as well.

This firmware will not erase or modify the built-in firmware, so no worries about bricking your device. If you remove the sd card and reboot the device, it will go back to the standard config.

While this can be annoying to some, the firmware is only in Alpha with non-open source code. There could be serious security risks, so this should only be used for testing and not production!

To install

Download Win32DiskImager

Try to use a 4GB or smaller MicroSD card for the install, if possible.

Download the latest IMG release file from here. (For instance openipc_v2-0.2.5.img or whichever release is newer). This will only work with the WyzeCamV2 not the V1

Open Win32DiskImager and select the IMG file and the target MicroSD drive.

To set the Wifi password, edit the file <drive letter>:\config\wpa_supplicant.conf and change

ssid="SSID"
to whatever your network name is. Also, change the password field.
psk="PW"

Save the file and remove the card. Unplug the Wyze Camera and insert the MicroSD card.

To write the firmware, press and hold the bottom setup button while plugging the camera back in.

In about 6 seconds, when the light turns blue, release the button. Wait a few minutes to see it on your network.

You can scan your network with a smartphone app like Fing or a Windows app like Angry IP Scanner to locate the camera. It will register ports:

21 ftp
22 ssh
23 telnet
80 http

If you browse to the ip from a browser, the login prompt will ask for a password. The default being:
dafang
ismart12

Blue Iris Setup

Adding the Wyze cam to Blue Iris is pretty straightforward. When you go to the config page it will provide you with the RTSP url. Just import this and that's it.


Just, bear in mind... this should not be used for anything other than testing. You cannot change the password (easily) and even then, the firmware changes are not permanent. 

An ideal solution would be to wait for the firmware to have a release candidate that allows you to add extra storage space that is instead being used for the OS.