TaoTronics Bluetooth Transmitter connected to my Samsung Soundbar

A couple of years ago I bought a discount sound bar to use as my computer speaker. I’ve been really happy with the sound quality. It’s connected via an optical cable to my computer and has a separate subwoofer.

This summer I moved into a new apartment, and during the last month I’ve run into a problem. One of my neighbors seems to be connecting to my soundbar via Bluetooth.

By watching the display I was able to at least learn what brand device was connecting. I still don’t know the exact model name. https://www.taotronics.com/bluetooth-transmitter-reset.html shows how to reset the device itself. Unfortunately my soundbar doesn’t have a way of setting the Bluetooth pairing code, or resetting the handshake with any devices that may want to connect with it, or fully disabling Bluetooth. https://www.samsung.com/us/support/owners/product/2015-soundbar-w-subwoofer-hw-j355

When I first noticed the problem, the sound bar was in a mode that would let Bluetooth turn on the sound bar, which was extremely frustrating when I was nearly asleep and the soundbar would start playing noises for no reason. That caused me to learn how to disable the Bluetooth power on feature of the sound bar.  Now at least it will only switch to Bluetooth when I’m actually using the soundbar for computer output.

The TaoTronics devices seem to be able to connect to multiple devices at the same time. I’m guessing that my neighbor has no idea that they are connecting to a second device at all. Obviously it’s built to make connecting to devices as easy as possible.

If anyone has suggestions on how to reject an already paired device from Bluetooth, I’d love to see it in the comments. I’m willing to use one of my Raspberry Pi devices that supports Bluetooth to see if there’s a way to send an interrupt signal.

Advertisements

Part 4 of ROAV Dash Cam C1 Pro

I’d figured out that a 128 GB micro sd card would yield about 16 hours of video on the ROAV Dashcam which was good enough that I could make most of my daily long drives without overwriting anything.

MicroSD-128

I had a PNY 128 GB drive that I’d been using in my GoPro so I put it into the ROAV Dashcam. The ROAV requires the card be formatted as FAT32 and not the newer exFAT, but the dashcam was able to do the formatting.

After a couple of months of use, I got a strange error on the ROAV saying that the memry card was corrupted and it needed reformatting. Before I did that, I put the card into my computer and tried to copy all the data off it. I ran into an issue with some files being corrupted, and then found I was not able to reformat the card in the computer, as it was somehow being reported as read only.

Because there is no physical write protect slider on a micro SD card, I fired up diskpart and issued the commands that should clear the write protect status on a drive.

2018-07-22 (1)

It appeared to work, but then checking the status after issuing the command attributes clear disk readonly showed that no changes had really happened.

I’d been frustrated trying to figure this out for the past week. Then I came across an article in comp.risks that described exactly this sort of issue.

Micro SD cards silently switching to read-only when they’re “too old”

Mon, 16 Jul 2018 23:38:44 +0200

The 64G Patriot micro SD I had been using in my cell phone from mid 2014
just decided to turn itself into a read-only memory card.  From what I read,
it most likely reached its maximum number of uses, as it happens at least
with some Samsung cards too.  It would be to protect the card from losing
all its data, after its cells were erased "too many times" (limit number
depending on the card, and appearing to be in the order of 10-100k).  And
according to Internet forums, and card reviews on Amazon, it looks like it's
getting more and more common!

A very bad point is that there were no error messages at all.  I added music
files before a trip, but I had none of the new files available later so at
first I thought I didn't do it correctly (even if the transfer was fine, it
could for example have been to my card backup on an hard drive instead of
going to the actual card).  Then, despite the pictures still being taken
correctly by my phone (browsing was OK, able to delete the bad ones...), I
lost all of the new ones when my phone rebooted. So they were only in a
cache memory somewhere, but nowhere on the SD card (not found by deep
recovery tools either).  More fun, the older ones I deleted came back during
the same reboot...

I understand it would be bothering to have an error message at each card
access, but at least I would have known to change the card and would not
have lost 3 days of pictures!  So beware...

I’ve written low level code dealing with flash memory in the past, so I understand that there are only so many rewrite times each sector can handle. I’m also familiar with the differences in file systems between FAT32, exFAT and NTFS. I don’t believe MicroSD cards have any sort of wear leveling algorithms in them that a full fledged SSD has between the flash and the controller. The fact that ROAV puts their constantly changing data two levels deep in the directory structure at least means the data for the root directory isn’t the constantly erased and overwritten sector, but it does mean that the directory structure is getting re-written each time a new file is created. They probably aren’t writing the directory data to a new sector each time, but just overwriting the old location, possibly accelerating the death of the microsd card. because the cluster size on a 128GB Fat32 partition is fairly large, at least 32KB, it holds a lot of directory entries in a single sector.

I had a 200 GB card that I thought I’d replace the failed drive with. The ROAV attempted to format it but reported that it couldn’t. I’m thinking that they simply cannot handle a drive bigger than 128 GB.

MicroSD-200

Since I had a second 128GB card, I put it into the dashcam. I’ll be interested in seeing how long it takes for it to report as non-functional.

 

Part 2 of FFMPEG and ROAV Dash Cam C1 Pro

While writing my software to concatenate and speed up the video files from my ROAV Dashcam I ran into an interesting issue with FFMPEG.

The -filter_complex option seems to stop parsing it’s parameters somewhere above 960 characters on the command line. I didn’t narrow down the exact point, or go digging in the FFMPEG source code to find the size. I expect this is an arbitrary buffer size in FFMPEG. I may contribute to the source code since it fails with no explanation, even when generating a report file. Learning the FFMPEG source structure in itself is a large task, meaning that I’ve not found time to do anything beyond find a workaround.

My workaround was to recognize when the command size will get long and fall back to using the -f concat option with a temporary file listing the input files instead of using the complex filtergraph.

The advantage of the complex filtergraph is twofold. It does not require a secondary input file or any cleanup. It can deal with input files that change resolution if necessary.

Here’s an example of the complex filtergraph:

ffmpeg.exe -report -i 2018_0705_101335_006.MP4 -i 2018_0705_101635_007.MP4 -i 2018_0705_101935_008.MP4 -i 2018_0705_102235_009.MP4 -i 2018_0705_102535_010.MP4 -i 2018_0705_102835_011.MP4 -i 2018_0705_103135_012.MP4 -i 2018_0705_103435_013.MP4 -i 2018_0705_103613_014A.MP4 -i 2018_0705_103615_015A.MP4 -i 2018_0705_104449_016A.MP4 -i 2018_0705_104750_017A.MP4 -i 2018_0705_105050_018A.MP4 -i 2018_0705_105350_019A.MP4 -i 2018_0705_105650_020A.MP4 -i 2018_0705_105950_021A.MP4 -i 2018_0705_110250_022A.MP4 -i 2018_0705_110550_023A.MP4 -i 2018_0705_110850_024A.MP4 -i 2018_0705_143415_025.MP4 -i 2018_0705_143716_026.MP4 -i 2018_0705_144016_027.MP4 -i 2018_0705_144316_028.MP4 -i 2018_0705_144616_029.MP4 -i 2018_0705_144916_030.MP4 -i 2018_0705_145216_031.MP4 -i 2018_0705_145516_032.MP4 -i 2018_0705_145816_033.MP4 -i 2018_0705_150116_034.MP4 -i 2018_0705_150416_035.MP4 -i 2018_0705_150716_036.MP4 -i 2018_0705_151016_037.MP4 -i 2018_0705_151316_038.MP4 -i 2018_0705_151616_039.MP4 -i 2018_0705_151916_040.MP4 -i 2018_0705_152216_041.MP4 -i 2018_0705_152516_042.MP4 -i 2018_0705_152816_043.MP4 -i 2018_0705_153116_044.MP4 -i 2018_0705_153416_045.MP4 -i 2018_0705_153716_046.MP4 -i 2018_0705_154016_047.MP4 -i 2018_0705_154316_048.MP4 -i 2018_0705_154616_049.MP4 -i 2018_0705_154916_050.MP4 -i 2018_0705_155216_051.MP4 -i 2018_0705_155516_052.MP4 -i 2018_0705_155816_053.MP4 -i 2018_0705_160116_054.MP4 -i 2018_0705_160416_055.MP4 -i 2018_0705_160716_056.MP4 -i 2018_0705_161016_057.MP4 -i 2018_0705_161316_058.MP4 -i 2018_0705_161616_059.MP4 -i 2018_0705_161916_060.MP4 -i 2018_0705_162216_061.MP4 -i 2018_0705_162516_062.MP4 -i 2018_0705_162816_063.MP4 -i 2018_0705_163116_064.MP4 -i 2018_0705_163416_065.MP4 -i 2018_0705_163716_066.MP4 -i 2018_0705_164016_067.MP4 -i 2018_0705_164316_068.MP4 -i 2018_0705_164616_069.MP4 -i 2018_0705_164916_070.MP4 -i 2018_0705_165215_071.MP4 -i 2018_0705_165516_072.MP4 -i 2018_0705_165815_073.MP4 -i 2018_0705_170115_074.MP4 -i 2018_0705_170415_075.MP4 -i 2018_0705_170715_076.MP4 -i 2018_0705_171015_077.MP4 -i 2018_0705_171315_078.MP4 -i 2018_0705_171615_079.MP4 -i 2018_0705_171915_080.MP4 -i 2018_0705_172216_081.MP4 -i 2018_0705_172515_082.MP4 -i 2018_0705_172815_083.MP4 -i 2018_0705_173115_084.MP4 -i 2018_0705_173415_085.MP4 -i 2018_0705_173715_086.MP4 -i 2018_0705_174015_087.MP4 -i 2018_0705_174315_088.MP4 -i 2018_0705_174615_089.MP4 -i 2018_0705_174915_090.MP4 -i 2018_0705_175215_091.MP4 -i 2018_0705_175515_092.MP4 -i 2018_0705_175815_093.MP4 -i 2018_0705_180115_094.MP4 -i 2018_0705_180415_095.MP4 -i 2018_0705_180715_096.MP4 -i 2018_0705_181015_097.MP4 -i 2018_0705_181315_098.MP4 -i 2018_0705_181615_099.MP4 -i 2018_0705_181915_100.MP4 -i 2018_0705_182215_101.MP4 -i 2018_0705_182515_102.MP4 -i 2018_0705_182815_103.MP4 -i 2018_0705_183115_104.MP4 -i 2018_0705_183415_105.MP4 -i 2018_0705_183715_106.MP4 -i 2018_0705_184015_107.MP4 -i 2018_0705_184315_108.MP4 -i 2018_0705_184615_109.MP4 -i 2018_0705_184915_110.MP4 -i 2018_0705_185215_111.MP4 -i 2018_0705_185515_112.MP4 -i 2018_0705_185815_113.MP4 -i 2018_0705_190115_114.MP4 -i 2018_0705_190415_115.MP4 -filter_complex [0:v][1:v][2:v][3:v][4:v][5:v][6:v][7:v][8:v][9:v][10:v][11:v][12:v][13:v][14:v][15:v][16:v][17:v][18:v][19:v][20:v][21:v][22:v][23:v][24:v][25:v][26:v][27:v][28:v][29:v][30:v][31:v][32:v][33:v][34:v][35:v][36:v][37:v][38:v][39:v][40:v][41:v][42:v][43:v][44:v][45:v][46:v][47:v][48:v][49:v][50:v][51:v][52:v][53:v][54:v][55:v][56:v][57:v][58:v][59:v][60:v][61:v][62:v][63:v][64:v][65:v][66:v][67:v][68:v][69:v][70:v][71:v][72:v][73:v][74:v][75:v][76:v][77:v][78:v][79:v][80:v][81:v][82:v][83:v][84:v][85:v][86:v][87:v][88:v][89:v][90:v][91:v][92:v][93:v][94:v][95:v][96:v][97:v][98:v][99:v][100:v][101:v][102:v][103:v][104:v][105:v][106:v][107:v][108:v][109:v]concat=n=110:v=1[v];[v]setpts=(1/60)*PTS,drawtext=fontfile=C\\:/WINDOWS/Fonts/consola.ttf:fontcolor=white:fontsize=80:y=main_h-text_h-50:x=50:text=WimsWorld[o] -map [o] -c:v libx265 -crf 23 -preset veryfast -movflags +faststart -bf 2 -g 15 -pix_fmt yuv420p -y “Output.mp4”

Here’s an example of the command where all the input files are defined in the temporary file:

ffmpeg.exe -report -f concat -safe 0 -i C:\Users\Wim\AppData\Local\Temp\Wim4BD3.tmp -vf setpts=(1/60)*PTS,drawtext=fontfile=C\\:/WINDOWS/Fonts/consola.ttf:fontcolor=white:fontsize=80:y=main_h-text_h-50:x=50:text=WimsWorld -an -c:v libx265 -crf 23 -preset veryfast -movflags +faststart -bf 2 -g 15 -pix_fmt yuv420p -y “Output.mp4”

 

FFMPEG and ROAV Dash Cam C1 Pro

I recently purchased a dedicated dashcam on sale to replace my GoPro setup for trip videos. This gives me a new need to understand a new file format.

2018-05-18

The Roav Dashcam stores sequential mp4 files. When configuring the camera it’s possible to set the loop time, which is the duration of each mp4. There’s also an option to watermark the files. I have it turned on, and the only thing I’ve noticed is the ROAV logo, timestamp, and speed in the bottom right. It does not appear to have a way of adjusting the size of the text.

My initial recordings were set to run at 1080p 60 fps. I wanted to concatenate multiple files, add some text of my own, and speed up the video. This was my first experience using the -filter_complex option of FFMPEG. Here’s what I came up with to put together three files, speed the output up by a factor of 60, and add some text. I’m dropping the audio completely. The ROAV can record audio inside the car, but I configured it not to, as I don’t want to hear what I was listening to on the radio or what I might be saying if I make a phone call..

ffmpeg.exe -hide_banner -i 2018_0512_130537_050A.MP4 -i 2018_0512_131537_051A.MP4 -i 2018_0512_132537_052A.MP4 -filter_complex "[0:v] [1:v] [2:v] concat=n=3:v=1 [v];[v]setpts=0.01666*PTS,drawtext=fontfile=C\\:/WINDOWS/Fonts/consola.ttf:fontcolor=white:fontsize=80:y=main_h-text_h-50:x=50:text=WimsWorld[o]" -map "[o]" -c:v libx265 -crf 23 -preset veryfast -movflags +faststart -bf 2 -g 15 -pix_fmt yuv420p  FirstMixSpeed60Concat.mp4

This first video was recorded at 1080p60. The camera can record at 1440p30 which I will be trying soon to see if things like license plates are more legible. The setpts factor that I’m currently using was 1/60, so that 1 minute of real time was compressed to 1 second of video, and just dropping the extra frames. I expect to need to change the setpts factor to 1/30 because of the decreased frame rate at the higher resolution.

SD Card Holder

I’d been traveling with several microSD cards for both GoPro and Drone usage for the past year when I finally got around to buying this inexpensive plastic card to organize them.

2018-02-16

Before buying it, I had read several reviews, and worried that cheap plastic might either make it brittle, or let the flash cards fall out of the enclosure. For $6.95 it was worth a try.

What I really found out was that I should have been using it for at least a year before I got it. The fact that I can carry 10 micro SD cards and they are all in order is a complete boon for organization.

20170922_185055016_iOSBefore using this, I’d often have two identical looking SD cards in my hands and forget which one was full and which one was empty. I’d also take a card out of my device and set it down, and nearly lose it.  Now I take a card out of my camera and immediately put it into this holder. I fill this holder from one end with empty cards and from the other with full cards and never have to remember which cards have something on them any more.

It’s essentially the same size as a credit card, but is quite a bit thicker. I wouldn’t carry it in my wallet, nor would I use the hole for a key ring, but having it in a pocket in my drone bag keeps all the memory cards in one place in a known order.

VLAN Tagging for CenturyLink

I’ve dealt with CenturyLink provided WiFi access points in two locations I’ve lived recently, and not been happy with their performance. My 5 year old Netgear WNDR3800 seemed to provide better speed with both 5GHz and 2.4GHz than the Actiontec C1900A provided by CenturyLink, which only supported 2.4GHz.

Unfortunately it was not as simple as learning the PPoE credentials that the Actiontec was using and putting those details into the Netgear. Centurylink in their infinite wisdom decided that the network packets need to be tagged to run on VLAN 201.

One solution would be to go out and buy a new WiFi router that supports VLAN Tagging. The newer Netgear Nighthawk routers support tagging, following the details at this support page.

The Netgear AC1900 router (also referred to as R7000) would do what I want, but would also cost close to $150.

Instead I spent $33 on a Netgear GS105Ev2 switch and spent a little time configuring its VLANs and am mostly happy with the result. My only disappointment is that this switch doesn’t seem to support SNMP for traffic monitoring.

gs105ev2

I have this configured so that Port1 connects to the Centurylink Fiber Termination Box, Port2 connects to my WNDR3800 WAN Port, and Port3 is connected to one of the LAN ports on the WNDR3800.

Port1 is configured to send Tagged Packets on VLAN 201.
Port2 is configured to send Untagged Packets on VLAN 201.
Ports 3-5 are configured to sent Untagged Packets on VLAN 1, the default for this switch.

The steps to get this working, starting with existing setup of Actiontec connected to Fiber Termination box.

  1. Connect GS105Ev2 Port3 to available LAN port on Actiontec and make sure link connection LEDs appear.
  2. Find what IP address the GS105Ev2 acquired on local network using a network scanning tool. I used  NirSoft Wireless Network Watcher and found that my switch was on 192.168.1.17. Going to http://192.168.1.17/ gave me a login to the new switch with the default password of “password”. gs105ev2-login
  3. You should get a switch information page similar to this.gs105ev2-login-successful
  4. Select the menu item VLAN, then 802.1Q and the radio button Enable. You should get a warning message that it’s about to erase all current VLAN settings. Hit OK.gs105ev2-vlan1
  5. Go under Advanced, VLAN Configuration, there’s a text box on the right that says VLAN ID. Enter 201 and push the Add button above it. gs105ev2-vlan2Now we have a new VLAN with no Port Members assigned.gs105ev2-vlan3
  6. Go to Port PVID on the left menu. Select Port 1. Type 201 in the text box. Hit Apply.gs105ev2-vlan4Select Port 2. Type 201. Hit Apply.gs105ev2-vlan5
  7. Now we go to the VLAN Membership setting. With the VLAN ID dropdown showing 1, click Port 1 and Port 2 through the available options until neither T nor U is showing, leaving Ports 3, 4, and 5 showing U. Then click Apply.gs105ev2-vlan6
  8. Now drop down to select VLAN 201. Click so that Port 1 is T, Port 2 is U, Ports 3, 4, and 5 are blank, and Apply.gs105ev2-vlan7
  9. If you look at the VLAN Configuration, you’ll now see that ports 1 and 2 are assigned to 201, while 3, 4, and 5 are assigned to 1.gs105ev2-vlan8
  10. At this point the GS105Ev2 has been configured as much as it needs to be. I had already configured my WNDR3800 to connect to the ISP using PPoE and given it the correct credentials.
  11. Power off Actiontec and put it in a closet. Connect Fiber Termination device to port 1 on GS105Ev2. Connect WNDR3800 WAN to port 2 on GS105Ev2. Optionally connect port 3 on GS105Ev2 to a lan port on WNDR3800, as it will only gain you one extra gigabit port compared to the four built into the WNDR3800.

Thanks to this post for the same information that I’ve presented here. I’d attempted to do this before with an existing GS108Tv2 switch I had sitting around. What I’d forgotten to do was make the port going to the WNDR3800 send Untagged packets. I’d been properly sending tagged packets to the fiber, but the WNDR3800 didn’t know what to do with the tagged packets. After confirming it worked with the GS108Tv2 I ordered the cheaper 5 port switch just to have something else to play with. My only disappointment with the 5 port switch is that it doesn’t seem to support SNMP to monitor the traffic going over the network.

FrSky X4rSB Receiver controlling Eachine Racer 250

I wanted to use S.Bus communication to connect my receiver to my new Eachine 250 
Racer drone. I wanted to be able to remotely control the lights on the drone. I wanted to bring back telemetry from the drone to my transmitter. All of those are possible with the X series receivers from FrSky.

20160513_093703

I’ve used the X8R receivers in the past, but I bought an X4R-SB receiver specifically for this drone.

In it’s default configuration it will output PWM on the pins for Channels 1 through 3 and S.Bus on the 4th connector. It has a separate input connection on the side for S.Port telemetry devices and an analog data line.

By putting a jumper on the signal pins, as shown in the picture above, during the binding process, the output is changed so that CPPM channels 1-8 are on the first port, PWM Channel 9 and 10 on the second and third ports, and S.Bus on the fourth port.

I’ve got the S.Bus connection going to the main port on my CC3D flight controller, a cable to control the lights on the third port (channel 10) and the first two ports remain unused. I have the momentary switch SH on my Taranis configured to control Channel 10. Toggling it cycles the LEDs on my Eachine Racer through the  off and on colored states.

The telemetry cable is connected first to a FrSky SP-GPS – Smart Port GPS Sensor (GPS-V2) and daisy chain connected to a FrSky SP-FLVS – Smart Port Lipo Voltage Sensor.

20160513_10061520160513_10062720160513_10162020160513_101628

The GPS Sensor is a new item in my arsenal. I’ve used GPS chips connected to my flight controllers in the past, which allow the flight controller to direct its flight position using GPS. Since this is not connected into the flight controller, it’s purely a toy, though it may help finding the drone if I get confused and crash it away from myself. The last data received in my transmitter remains on the display, which I could then use to assist my search for the drone.

The voltage sensor connects to the balance plug on the battery, allowing me to monitor the state of the individual battery cells during flight, as well as having low battery alerts reported on the overall voltage.

For installation of this receiver in my drone, I’d come across a 3d model for a holder. I had never used a 3d printer before, though I’ve been fascinated with them for several years. I realized that Windows 10 has a 3d Modeling program installed by default, 3D Builder, and that it can print using an on-line service.  Because the service accepts the file and tells you how much it is going to cost delivered, this was an easy first try. I downloaded files for both a battery protector tray and the previously mentioned receiver tray, merged them into a single model file, and had them delivered for $27.15. Other than the time involved for the delivery I was happy with the result. I submitted the order on 4/26/2016. I received notice that it shipped on 5/10/2016. It finally arrived on 5/13/2016.

20160517_17394420160517_17375520160517_174014

The design here has the receiver extending in the model over the flight controller and under the video transmitter. I’m not positive that I’m going to use the battery tray. If I don’t use it, I just need to get screw extenders to install the receiver directly above the flight controller.