Browsed by
Category: Problem solutions

Connecting iSpy to an Amcrest IP2M-841 webcam

Connecting iSpy to an Amcrest IP2M-841 webcam

This was more annoying than it should have been. When setting up my Amcrest IP2M-841B camera, I was able to use the Amcrest IP Config tool to log in and watch my camera without issue.

When using iSpy 64, however, the darn thing couldn’t figure out how to connect to it. Here’s how I did it. I left the camera on channel 1, set the encoding to plain H.264, and then did the following.

Test your camera using Amcrest IP config.

The first thing is to make sure your camera is working at all:

  1. Be sure you can open the IP config tool and see your cameras.
  2. Make sure passwords are correct, you can get a live view, and that it’s set to H.264 encoding and the channels are correct.

 

Test your rtsp line using VLC:

  1. Open VLC (install it if you need)
  2. Media->Open Network Stream
  3. Copy in your rtsp: address
    1. example without the username/password:
      1. rtsp://192.168.1.99:554/cam/realmonitor?channel=1&subtype=0
      2. VLC will ask for your username/password and you can enter it.
    2. example with the username/password:
      1. rtsp://<username>:<password>@<ipaddress>:554/cam/realmonitor?channel=1&subtype=0
      2. I left the arguments as –rtsp-caching=100 (the default)
  4. You should see your stream come up in VLC
  5. NOTE: When setting your password, if you have any special characters like %!&#$ – or the like – be sure to convert them to their equivalent hex ASCII codes. See this chart here.
    1. Example: if your password is ‘cat&dog’, you should use the password: ‘cat%26dog’

Connecting to iSpy

If connecting via VLC worked, your 75% of the way there.

  1. Start iSpy
  2. Add->IP Camera
  3. Select the VLC Plugin tab (I have VLC installed, not sure if that’s 100% necessary)
  4. Set the VLC URL to what you had above (with the username+password):
    rtsp://<username>:<password>@<ipaddress>:554/cam/realmonitor?channel=1&subtype=0
  5. When setting the password, if you have any special characters like %!&%#$ – or the like – be sure to convert them to their equivalent hex ascii codes. See this chart here.
    1. Example: if your password is ‘cat&dog’, you should use the password: ‘cat%26dog’
  6. I left the arguments as –rtsp-caching=100 (the default)

Once you have iSpy connected, you can set up events and connect to the cloud for full web monitoring.

 

Resources:

So, where did I get that rtsp line? Directly from the Amcrest HTTP API SDK Protocol Specification. Section 4.1.1, p14 – Get real-time stream. It’s also a handy guide on all the other parameters you can send the camera.

The value of ESP was not properly saved across a function call…

The value of ESP was not properly saved across a function call…

Windows can trigger this error, but sometimes it’s not easy to figure out what’s going on.

I recently got this error when trying to use the OpenGL ES ANGLE library on Windows 10. When compiling against the ANGLE library, the error came when trying to call into the ANGLE and used eglGetProcAddress().

eglGetProcAddress() returns function pointers for important GL extensions, so I couldn’t just ignore it or work around it.

In looking around, the obvious first step is to make sure you’re defining the function pointers correctly, but that turns out not to be my problem.

In looking at this article, I realized I probably had a mismatch of compiler and linker settings. The Visual Studio projects (VS2008) that came with ANGLE required a certain set of compiler and linker flags that were not standard. I had migrated the Visual Studio projects to VS2015, so that also added an element of uncertainty. I simply opened both project settings up next to each other and compared the settings for the ANGLE library build and the final project and found a few mismatches. I change a number of them to be the same, and things worked great.

Summary:
Check the linking AND compiling flags for not only your project, but the project files that generate the libraries you’re linking against. Differences in compiler settings can cause this error.

NVidia GTX 1070’s – flickering and artifacts

NVidia GTX 1070’s – flickering and artifacts

If you own a GeForce GTX 1070, you might want to pay attention to this news item as you could be effected by this memory issue.

Some users have reported they noticed occasional flickering or graphical artifacts on multiple brands of the 1070. Right now most of the major vendors are working on (or already issuing) a BIOS firmware update for their graphics cards.

Investigation has shown the issues are graphics memory related. GeForce GTX 1070 cards fitted with Samsung memory do not appear to have any issues but some manufacturers have switched towards Micron chips and these appear to be the culprit. This is noticed most during overclocking the graphics memory subsystem. The problem is in the the speed of the voltage adjustment from the low power idle P-States for memory voltage under load. If you can keep the idle voltage above 0.800V before you apply the overclock, you never see the issue.

A number of manufacturers have been working on VBIOS updates, so be sure to check your vendor:

Full info:
http://www.guru3d.com/news-story/manufacturers-roll-out-firmware-updates-for-geforce-gtx-1070-due-to-memory-issue.html

git’s git:// protocol fails, but git http:// succeeds

git’s git:// protocol fails, but git http:// succeeds

A number of source websites expose their source via the git:// protocol. Unfortunately, the git protocol recently broke on one I used, but the git http:// protocol was working. Instead of changing my fetching scripts, I found a clever url replacement in git using the following command:

git config --global url.https://gitsite.com/.insteadOf git://gitsite.com/

This allows you to change the protocol per URL instead of globally. Exactly what I needed.

Using puTTY with usb serial ports on Fedora/Ubuntu/Linux/etc

Using puTTY with usb serial ports on Fedora/Ubuntu/Linux/etc

Serial ports are a thing of yesteryear, but never seem to go away. If you have a USB adapter that exposes serial ports to your favorite Linux branch, knowing how to get to them isn’t intuitive.

puTTY is a great terminal emulator, and you can connect to whichever port is exposed using the following format:

sudo putty /dev/ttyUSB0 -serial -sercfg 115200,8,n,1,N

If it’s on a different port, use /dev/ttyUSB1, etc.

As for cables that expose a serial port via USB, I recommend the Sabrent USB 2.0 to Serial (9-Pin) DB-9 RS-232 Converter Cable using the Prolific Chipset.

Mounting a Windows hosted samba share from Linux (Fedora/Ubuntu/etc) – with a domain account

Mounting a Windows hosted samba share from Linux (Fedora/Ubuntu/etc) – with a domain account

Samba shares can be finicky beasts. Mounting a samba (smb) point shared from a Windows host doubly tricky at times due to cross-platform differences such as domains.

If you ever find yourself trying to mount a Windows hosted Samba share and need to log in with a domain account, here’s the format:

sudo mount -t cifs -o domain=<YOURDOMAIN>,username=<YOURUSERNAME>,password=<YOURPASSWORD> //<HOSTNAME>/TestShare /mnt/

This mounts <hostname> which can be either an ip address or host name to the directory /mnt/ when using the proper domain, username and password. Whew.

You can also test your connection by using smbclient, which seems to have a more forgiving syntax.:

smbclient //<HOSTNAME>/TestShare -U <YOURDOMAIN>/<YOURUSERNAME>
ex:
smbclient //myhost.com/TestShare -U ibmdom/billwaters

This would connect you to myhost.com/Testshare directory using the user account billwaters that is part of the ibmdom domain. It would then prompt you for your password. You can also optionally add the password to the command line, but this allows you to type it in separately.

Using a physical drive/raw drive access with Virtualbox

Using a physical drive/raw drive access with Virtualbox

This comes from the good article here, or in the VirtualBox documentation.

Virtualization has been a tremendous help to developers such as myself. It keeps us from having to keep a pile of hard drives/machines all running different operating systems. And while this is great, there are some times when you might want to use a raw hard drive. For example, if you pull a hard drive out of an existing system and want to keep the OS/data intact but use it as a virtual machine inside another host OS.

Well, you can set up VirtualBox to use a physical hard drive inside a VM. This method is called “raw hard disk access.” This allows you to mount or boot a secondary hard drive or external USB as your storage device inside the VM.

Warning: Do not attempt to mount or boot the partition that runs the host OS with a VM, as that can lead to severe data corruption. And no matter which drive or partition you want to mount, it’s always a good idea to back up any existing data on it before continuing.

Creating the Virtual Machine:

You’ll first want to create a virtual machine within the VirtualBox GUI. Choose all options like normal, but when asked about the virtual hard drive, select Do not add a virtual hard drive.

Next, you’ll need to find the path and drive number of the physical drive you’d like to mount:

In Windows, open Disk Management. You’ll see the associated drive numbers on the left and will identify them later as PhysicalDrive0, PhysicalDrive1, etc.

In Linux, run the following command: sudo fdisk -l. You’ll see a listing of the partitions. Make note of the desired drive in the format of dev/sda0, dev/sda1, etc.

In Mac OS X, use the following command: diskutil list. You’ll see a listing of the partitions. Make note of the desired drive in the format of /dev/disk0, /dev/disk1, etc.

Now open a command prompt on your OS. If you’re using Windows as the host OS you will also need to go to the root directory of VirtualBox using the following command: cd C:\Program Files\Oracle\VirtualBox

Creating the VirtualBox Hard Drive:

Now you can run the command to create the virtual hard drive file that points to your desired physical drive. For each of the following examples ensure that you input the desired names between the arrows and replace the number or pound sign with your desired drive number.

For Windows:
You often must be administrator to run this command. Make sure your cmd.exe is running as administrator. This also means you must start VirtualBox as administrator to use these drive links.

VBoxManage internalcommands createrawvmdk -filename "C:\Users\\VirtualBox VMs\\.vmdk" -rawdisk \\.\PhysicalDrive#

For Linux:

VBoxManage internalcommands createrawvmdk -filename ".vmdk" -rawdisk /dev/sda

For Mac OS X:

VBoxManage internalcommands createrawvmdk -filename ".vmdk" -rawdisk /dev/disk#

This VMDK will be a very small file that simply points to your physical drive. Now you can attach the VMDK to your VM. To do so, open the VirtualBox GUI, select the desired VM, click Settings, clickStorage, click Add Hard Disk button, select Choose existing drive, and then select the VMDK file you just created.

CMake with compilers that need custom parameters

CMake with compilers that need custom parameters

When using CMake on non-GCC/non-Microsoft compilers – you often run into interesting problems. Especially true for embedded devices/cross-compilers.

One thing that can bite you is the fact that CMake requires the compiler to pass a ‘smoke’ test. Unfortunately, if there are required parameters for your compiler, the smoke test part will fail.

There are a few ways to solve this, the ‘recommended’ way seems to be via the CMAKE_FORCE_C_COMPILER/CMAKE_FORCE_CXX_COMPILER flags. This allows you to tell CMake what the compiler is and pass the smoke test.

CMAKE_FORCE_C_COMPILER(/usr/mycc/cxint86 GNU)
CMAKE_FORCE_CXX_COMPILER(/usr/mycc/cxxint86 GNU)

Here are the docs for more information
https://cmake.org/Wiki/CMake_Cross_Compiling#The_toolchain_file

Canoscan Lide 25, Photoshop CC, Windows 7, TWAIN, and you!

Canoscan Lide 25, Photoshop CC, Windows 7, TWAIN, and you!

I recently upgraded from Photoshop CS5 to Photoshop CC and it has been a great improvement overall.  However, I still have my old Canoscan LIDE 25 scanner that uses TWAIN.  If you remember, this involved a bit of tweaking when I went to get it to work with CS5  and CS6.

At any rate, here’s how you get your Canon Canoscan LiDE25 (or other TWAIN scanner) working with Photoshop CC on Windows 7:

  1. Install the CanoScan LIDE 25 driver.  You can find that on the Canon download page (or download it here locally if they ever stop updating it)
  2. Adobe does not have TWAIN support installed in Photoshop by default anymore.  Instead, you must download their Optional Plugin pack.  It’s important to note that you download the CS6 plugin pack for CS6 or CC editions.  Also note, the TWAIN support only works on the 32-bit version of Photoshop.  It will NOT work on 64-bit versions of Photoshop.
    1. Download the Optional pack
    2. Close Photoshop
    3. Install the option pack by copying it in the right plugin directory for your 32-bit version of Photoshop (see their website for the right directory)
    4. Open Photoshop (32-bit version)
  3. So, you installed the scanner driver and Photoshop is updated.  I open Photoshop and go to File->Import->Canoscan LiDE25.  Sadly, I then get this error message: “Could not open the TWAIN sourceMake sure there is a valid source for your scanner in the TWAIN Directory found in the Window Directory.”Hmmm, what is going on?  I try running the CanoScan Toolbox and when I copy/PDF and hit the ‘Copy’ or ‘Scan’ button, I get this error message:Unable to open TWAIN source. Please check connection then re-start Toolbox.However, if I use a 3rd party tool like VueScan – it is able to capture scans just fine.  So I know the scanner is physically working.
  4. I found this badly aged/broken blog entry, but it describes the solution:
    1. Go to your c:Windowstwain_32 directory
    2. You should see a sub-folder with a number/letter combination,  Mine is: C:Windowstwain_32CNQL25
    3. Add that to your system path variable
      1. Right-click on Computer -> Properties -> Advanced system settings -> Advanced -> Environment Variables
      2. In the bottom System variables scroll-box, find the ‘Path’ variable
      3. Click edit and go to the far right of the ‘Variable value:’ field. Enter the directory to the end of the list, separating it from previous entries by a ‘;’.  Google adding a directory to system path in Windows if you need more help.
        i.e. ;C:Windowstwain_32CNQL25
      4. Save and close the system settings
  5. Restart Photoshop 32-bit – and you should have success!
VS2013 annoyances

VS2013 annoyances

Visual Studio 2013 is by-and-large a pretty nice development environment, but there are at least 2 things that REALLY annoy me.

1. Changed all the default hot keys.  I mean – really?  You just change all the standard hot keys that you’ve used for, oh, I don’t know, the last 3 releases for….no good reason at all?  I’ve had to go back and reset a lot of them.  Why?  I can’t think of any good reason to change defaults you’ve used forever.  If people want to change them, let them change them through the keyboard configurations.

2. Automatically switching to Error List when Visual Studio completes compiling.  Maybe I’m just old-fashioned, but I need to see the Output panel – NOT Error List.

Here’s how to change it back:
1. Tools -> Options -> Projects and Solutions -> General
2. uncheck ‘Always show Error List if build finishes with errors