Welcome to Radarspotting. Please login or sign up.

May 02, 2024, 04:13:46 PM

Login with username, password and session length

New Members

New Members

You should get an activation email when you join.  If not, please use the Contact option.

ModeSDeco2 and ModeSMixer2 - console programs for RTLSDR and transcoding

Started by sergsero, August 09, 2013, 03:08:08 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

doctorvenables

Interestingly, stopping and then starting the mm2 service also resets all of the data, without a reboot. That's odd?

doctorvenables

[NOT-SOLVED]
Thought the answer was that I'd put my BaseStation.sqb in a directory in ~/name/to/dir and not in /usr/share/mm2

I guess that the permissions were wrong to do it my previous way.
Have put BaseStation.sqb into /usr/share/mm2
Have now rebooted a couple of times still with no data persistance!

andrewt

I tried the github download it works, as soon as i reboot there is no sign of modesmixer2 on the pi 3+ with Buster, dump1090-mutability and piaware, I also have a micro SD card with dump1090-fa with same set up, no folders, nothing. I like the software, but to get it functioning the way it is intended is very frustrating. Listing the series of code input is not giving the results. Maybe it just me.

abcd567

Quote from: doctorvenables on August 16, 2019, 10:47:42 PM
[NOT-SOLVED]
Thought the answer was that I'd put my BaseStation.sqb in a directory in ~/name/to/dir and not in /usr/share/mm2

I guess that the permissions were wrong to do it my previous way.
Have put BaseStation.sqb into /usr/share/mm2
Have now rebooted a couple of times still with no data persistance!

It does not matter where you put your file BaseStation.sqb, as long as you mention its full path in config file.

I have placed it in folder /usr/share/mm2 and the data has persistance and does not disappear on reboot.

File permission for BaseStation.sqb is 644 (rw--r--r)


ls -l /usr/share/mm2/BaseStation.sqb
-rw-r--r-- 1 root root 3931136 Aug 17 01:44 /usr/share/mm2/BaseStation.sqb



This is my config file. You can see I have specified the full path.
Also take care that some data files have capital S (BaseStation) while some have small s (Basestation). In config file you should use exact same spelling as is the file name. Capital and small letters make difference.


cat /usr/share/mm2/mm2.conf

--inConnectId 127.0.0.1:30005:ADSB
--inConnectId 127.0.0.1:30105:MLAT

--web 8787
--location 43.xxxx:-79.xxxx
--db /usr/share/mm2/BaseStation.sqb



ls /usr/share/mm2
BaseStation.sqb  mm2.sh                                modesmixer2.txt
LICENSE.MIT      modesmixer2
mm2.conf         modesmixer2_rpi2-3_deb9_20190223.tgz

abcd567

Quote from: andrewt on August 17, 2019, 03:46:59 AM
I tried the github download it works, as soon as i reboot there is no sign of modesmixer2 ...... no folders, nothing.

(1) This can happen if your file system is mounted as "read only file system".
Give following command to make your file system "read and write", and after that run the github script to install modesmixer2.

sudo mount -o remount,rw /



(2) Please post output of following commands:

ls /usr/share/mm2/

ls /lib/systemd/system/mm2.service

sudo systemctl status mm2

doctorvenables

I've been pretty careful about capitals etc.
Here are the relevant listings/config files. Location and google-api key altered obvs!
The rtl stick is attached to a pi-zero with IP 192.168.1.149 wouldn't have thought that made a difference though.

pi@venablespi:/usr/share/mm2 $ ls -l
total 104896
-rw-r--r-- 1 root root 50164736 Aug 17 09:25 BaseStation.sqb
-rw-r--r-- 1 root root 22287888 Aug 17 00:19 FLAGS_FOR_UPLOAD_SIDE_VIEWS_V12.zip
-rw-r--r-- 1 pi   pi       1117 Dec 31  2014 LICENSE.MIT
drwxr-xr-x 2 root root   262144 Aug 17 00:19 OperatorFlags
drwxr-xr-x 2 root root   258048 Aug 17 00:20 Silhouettes
drwxr-xr-x 2 root root    36864 Aug 17 00:18 Silhouettes.old
-rw-r--r-- 1 root root 15077376 Aug 16 22:33 flightroute-icao.sqb
-rw-r--r-- 1 root root 14377984 Aug 16 22:33 flightroute.sqb
-rw-r--r-- 1 root root      302 Aug 16 23:23 mm2.conf
-rw-r--r-- 1 root root      108 Aug 16 18:30 mm2.conf.bak
-rwxrwxrwx 1 root root      137 Aug 16 18:30 mm2.sh
-rwxr-xr-x 1 root pi    3197768 Feb 24 07:18 modesmixer2
-rw-r--r-- 1 pi   pi       9185 Feb 24 09:32 modesmixer2.txt
-rw-r--r-- 1 root root  1705150 Aug 16 18:30 modesmixer2_rpi2-3_deb9_20190223.tgz


pi@venablespi:/usr/share/mm2 $ cat mm2.conf
--silhouettes /usr/share/mm2/Silhouettes
--db /usr/share/mm2/BaseStation.sqb
--frdb /usr/share/mm2/flightroute.sqb
--inConnectId 192.168.1.149:30005:ADSB
--inConnectId 192.168.1.149:30105:MLAT
--web 8787
--location 52.xxx:1.xxx
--google-key My_key




abcd567

@doctorvenables:

All seems OK.

There is a possibility that BaseStation.sqb is corrupt or in a format different than what is acceptable to ModeSMixer2.

What is the source of your BaseStation.sqb? I have copied it from VRS (C:\Users\abcd\AppData\Local\VirtualRadar\BaseStation.sqb)

I have installed "database writer pluin" in my VRS,  which generated this file. It was very small size when generated (no data) but is gradually growing in size as more data is collected. I copied it from Windows Desktop to RPi using FileZilla SFTP.

doctorvenables

That's a good question. Will have a look through my history..
Simple answer is I can't remember. What I do know is that it is over 50 Mb now and growing all the time.

Perhaps the answer is to start afresh with BaseStation.sqb (as it doesn't seem to be doing me any favours anyway!)

doctorvenables

Yup think answer is to re-install VRS and go from there.

Can't remember now why I ditched VRS in the first place - perhaps it was the charts display in modesmixer.

Chances are I can have both running if VRS fixes the db problem...
THanks for all of your suggestions @abcd567

sergsero

Hello doctorvenables,

I can assume that the issue is files permission and access modes in Unix. On your screenshot above (pi@venablespi:/usr/share/mm2 $ ls -l) the files in the directory related to different users (standard and privileged) and groups: pi and root. Above, superuser root is owner of the file "-rw-r--r-- 1 root root 50164736 Aug 17 09:25 BaseStation.sqb" and only it can write to this file.

If you run the program from the PI user, then all other related files must also belong to the pi user (or have read and write access for pi).
Your file is currently owned by root and is not writable by the modesmixer2 that has pi user rights.

I would suggest that you run a command that change the ownership of a directory and all the files contained inside (use the recursive option with the -R flag) to the "pi" user in the "pi" group:
sudo chown -R pi:pi /usr/share/mm2/

The chown command stands for "change owner" and is used to change the owner of a file.


Best regards,
sergsero

andrewt

Quote from: abcd567 on August 17, 2019, 09:17:14 AM
Quote from: andrewt on August 17, 2019, 03:46:59 AM
I tried the github download it works, as soon as i reboot there is no sign of modesmixer2 ...... no folders, nothing.

(1) This can happen if your file system is mounted as "read only file system".
Give following command to make your file system "read and write", and after that run the github script to install modesmixer2.

sudo mount -o remount,rw /



(2) Please post output of following commands:

ls /usr/share/mm2/

ls /lib/systemd/system/mm2.service

sudo systemctl status mm2


pi@raspberrypi:~ $ ls /usr/share/mm2/
LICENSE.MIT  mm2.sh       modesmixer2_rpi2-3_deb9_20190223.tgz
mm2.conf     modesmixer2  modesmixer2.txt
pi@raspberrypi:~ $ ls /lib/systemd/system/mm2.service
/lib/systemd/system/mm2.service
pi@raspberrypi:~ $
pi@raspberrypi:~ $ sudo systemctl status mm2
● mm2.service - ModeSMixer2
   Loaded: loaded (/lib/systemd/system/mm2.service; enabled; vendor preset: enab
   Active: active (running) since Sat 2019-08-17 01:53:04 EDT; 9h ago
Main PID: 453 (bash)
    Tasks: 5 (limit: 2200)
   Memory: 8.1M
   CGroup: /system.slice/mm2.service
           ├─453 /bin/bash /usr/share/mm2/mm2.sh
           └─472 /usr/share/mm2/modesmixer2 --inConnectId 127.0.0.1:30005:ADSB -

Aug 17 07:59:45 raspberrypi modesmixer2[453]: 2019-08-17 07:59:45.085  ERROR   
Aug 17 07:59:45 raspberrypi modesmixer2[453]: 2019-08-17 07:59:45.085  INFO     
Aug 17 08:00:10 raspberrypi modesmixer2[453]: 2019-08-17 08:00:10.086  INFO     
Aug 17 08:00:10 raspberrypi modesmixer2[453]: 2019-08-17 08:00:10.086  ERROR   
Aug 17 08:00:10 raspberrypi modesmixer2[453]: 2019-08-17 08:00:10.086  INFO     
Aug 17 08:00:56 raspberrypi modesmixer2[453]: 2019-08-17 08:00:56.087  INFO     
Aug 17 08:00:56 raspberrypi modesmixer2[453]: 2019-08-17 08:00:56.087  INFO     
Aug 17 08:02:56 raspberrypi modesmixer2[453]: 2019-08-17 08:02:56.644  INFO     
Aug 17 08:46:10 raspberrypi modesmixer2[453]: 2019-08-17 08:46:10.612  INFO     
Aug 17 08:46:10 raspberrypi modesmixer2[453]: 2019-08-17 08:46:10.612  INFO     
lines 1-20/20 (END)


Hi abcd567
Above is the outcome of what you ask me to do

andrewt

@abcd567 hi,
Forgive me i
I am new to how posting is done, where one can separate the code from the comments but you can scroll my recent post and let what has to be done to fix this 

abcd567

Quote from: andrewt on August 17, 2019, 04:13:31 PM


pi@raspberrypi:~ $ sudo systemctl status mm2
● mm2.service - ModeSMixer2
   Loaded: loaded (/lib/systemd/system/mm2.service; enabled; vendor preset: enab
   Active: active (running) since Sat 2019-08-17 01:53:04 EDT; 9h ago
Main PID: 453 (bash)
    Tasks: 5 (limit: 2200)
   Memory: 8.1M
   CGroup: /system.slice/mm2.service
           ├─453 /bin/bash /usr/share/mm2/mm2.sh
           └─472 /usr/share/mm2/modesmixer2 --inConnectId 127.0.0.1:30005:ADSB -

Aug 17 07:59:45 raspberrypi modesmixer2[453]: 2019-08-17 07:59:45.085  ERROR   
Aug 17 07:59:45 raspberrypi modesmixer2[453]: 2019-08-17 07:59:45.085  INFO     
Aug 17 08:00:10 raspberrypi modesmixer2[453]: 2019-08-17 08:00:10.086  INFO     
Aug 17 08:00:10 raspberrypi modesmixer2[453]: 2019-08-17 08:00:10.086  ERROR   
Aug 17 08:00:10 raspberrypi modesmixer2[453]: 2019-08-17 08:00:10.086  INFO     
Aug 17 08:00:56 raspberrypi modesmixer2[453]: 2019-08-17 08:00:56.087  INFO     
Aug 17 08:00:56 raspberrypi modesmixer2[453]: 2019-08-17 08:00:56.087  INFO     
Aug 17 08:02:56 raspberrypi modesmixer2[453]: 2019-08-17 08:02:56.644  INFO     
Aug 17 08:46:10 raspberrypi modesmixer2[453]: 2019-08-17 08:46:10.612  INFO     
Aug 17 08:46:10 raspberrypi modesmixer2[453]: 2019-08-17 08:46:10.612  INFO     
lines 1-20/20 (END)


Hi abcd567
Above is the outcome of what you ask me to do

Hi Andrew
I can see two lines with ERROR at the end. The text after ERROR shows what has gone wrong. Unfortunately rest of the text after ERROR did not appear as width of your PuTTY window is small.

Please increase the width of PuTTy window and then give command sudo systemctl status mm2, and post the output.

Below is my output after I increased the width of PuTTY (almost doubled), and after increasing width issued command sudo systemctl status mm2

Scroll right to see in full


Aug 17 14:38:07 raspberrypi modesmixer2[3092]: 2019-08-17 14:38:07.013  INFO     inConnectId(127.0.0.1:30005:ADSB) connected
Aug 17 14:38:07 raspberrypi modesmixer2[3092]: 2019-08-17 14:38:07.295  INFO     inConnectId(127.0.0.1:30005:ADSB) BEAST data stream detected
Aug 17 14:38:10 raspberrypi modesmixer2[3092]: 2019-08-17 14:38:10.270  INFO     Coverage area was determined
Aug 17 14:38:10 raspberrypi modesmixer2[3092]: 2019-08-17 14:38:10.270  INFO     Magnetic declination calculated
Aug 17 14:38:10 raspberrypi modesmixer2[3092]: 2019-08-17 14:38:10.305  INFO     Coverage area was determined
Aug 17 14:38:10 raspberrypi modesmixer2[3092]: 2019-08-17 14:38:10.306  INFO     Magnetic declination calculated
Aug 17 14:38:10 raspberrypi modesmixer2[3092]: 2019-08-17 14:38:10.387  INFO     inConnectId(127.0.0.1:30105:MLAT) BEAST data stream detected

abcd567

I have created a BaseStation.sqb by VRS using it's "Database Writer Plugin".
Before I created this file, I disconnected RPi (from where VRS used to get data), so it does not contain any aircraft data. Therefore it's size is only 44 kb.

I use it as starting point. I copied this data-less file to RPi folder /usr/share/mm2/, restarted modesmixer2, and the file BaseStation.sqb immediately started growing in size, indicating modesmixer2 has started storing data in it. However strange thing is that in spite of storing the data in BaseStation.sqb (as indicated by it's growing size), the data was NOT displayed on Map and Flights table .
I tried reboot after 15 minutes, then again after half an hour, the data did NOT disply.

I changed ownership of folder mm2 (recursive) to pi:pi, but data still did not display.

The size of file BaseStation.sqb however keeps growing. I started with a data-less BaseStation.sqb of size 44 kb few hours ago, and now it is 722 kb, and still growing.

Please see screenshot below showing missing info. This applies to ALL aircrafts, and even many hours after starting modesmixer2,

[attachment deleted reduce file load]

andrewt

● mm2.service - ModeSMixer2
   Loaded: loaded (/lib/systemd/system/mm2.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2019-08-17 19:32:02 EDT; 1h 26min ago
Main PID: 447 (bash)
    Tasks: 5 (limit: 2200)
   Memory: 8.5M
   CGroup: /system.slice/mm2.service
           ├─447 /bin/bash /usr/share/mm2/mm2.sh
           └─450 /usr/share/mm2/modesmixer2 --inConnectId 127.0.0.1:30005:ADSB --inConnectId 127.0.0.1:30105:MLAT --web 8787 --location 13.09841:-59.58619

Aug 17 19:32:29 raspberrypi modesmixer2[447]: 2019-08-17 19:32:29.793  ERROR    inConnectId(127.0.0.1:30105:MLAT) connect host 127.0.0.1:30105 error Connection refused
Aug 17 19:32:29 raspberrypi modesmixer2[447]: 2019-08-17 19:32:29.793  INFO     inConnectId(127.0.0.1:30105:MLAT) reconnect in 37 seconds
Aug 17 20:52:24 raspberrypi modesmixer2[447]: 2019-08-17 20:52:24.199  INFO     inConnectId(127.0.0.1:30105:MLAT) connecting 127.0.0.1:30105
Aug 17 20:52:24 raspberrypi modesmixer2[447]: 2019-08-17 20:52:24.199  ERROR    inConnectId(127.0.0.1:30105:MLAT) connect host 127.0.0.1:30105 error Connection refused
Aug 17 20:52:24 raspberrypi modesmixer2[447]: 2019-08-17 20:52:24.199  INFO     inConnectId(127.0.0.1:30105:MLAT) reconnect in 77 seconds
Aug 17 20:52:28 raspberrypi modesmixer2[447]: 2019-08-17 20:52:28.560  INFO     Coverage area was determined
Aug 17 20:52:28 raspberrypi modesmixer2[447]: 2019-08-17 20:52:28.560  INFO     Magnetic declination calculated
Aug 17 20:53:41 raspberrypi modesmixer2[447]: 2019-08-17 20:53:41.200  INFO     inConnectId(127.0.0.1:30105:MLAT) connecting 127.0.0.1:30105
Aug 17 20:53:41 raspberrypi modesmixer2[447]: 2019-08-17 20:53:41.201  INFO     inConnectId(127.0.0.1:30105:MLAT) connected
Aug 17 20:55:41 raspberrypi modesmixer2[447]: 2019-08-17 20:55:41.939  INFO     inConnectId(127.0.0.1:30105:MLAT) BEAST data stream detected

@abcd567 above is the completed message