Daily Log/E-Mail Aircraft Report directly on your RaspberryPi

run as aggregator via socat just to test how much script + sendmail uses cpu+mem

I’m having some problem with the hex code in excel, it converts some code into scientific format.

The first column is how it shows up in Excel, the second column is the registration I found from using FR24 using the call sign and the last column is the correct hex code.

Those without registrations did not have call signs showing.

14/10/17

4.05E+25
4.01E+12 = G-EZBU = 4010E9
3.99E+10 = F-HEPH = 3991E7
4E+77 = G-VYOU = 400E75
4.07E+10 = G-JZHT = 4070E7
4.07E+06 = G-JZHT = 4070E7
4.007E+11
4.07E+12 = G-JZHV = 407079

15/10/17

4.07E+.03
4.05E+68 = G-ECOI = 405E66
4.06E+66
4.00E+39
4.00E+61
3.96E+05
4.00E+16 = G-EZAV = 400E14
3.99E+03
4.06E+69 = G-EZOV = 406E67
4.01E+12
3.99E+08
4.07E+10
4.00E+41
4.05E+25 = G-FDZR = 405E23
4.07E+04 = G-JZHM = 4070E1
8.96E+03
4.01E+11 = G-TCDZ = 4007E8
3.99E+07
4.07E+12 = G-JZHV = 4070E9
4.07E+06 = G-JZHO = 4070E3

if you open the csv with texteditor instead excel - how do the hex-values look there?

Notepad and Wordpad, it’s just random symbols
Word will not open it.

When I first open it using Office 2007 Excel is says

“The file you are trying to open egbw_aircraft.xls is in a different format than specified by the file extension. Do you want to open the file now?”

nope - a real texteditor (what’s none of the windows built in really is) like notepad++ or ultraedit or …
sorry i’m on mac os x

seems to be one of the endless number of excels funny behaviors - if i open excel and go to file->new file and then type into a random field 405e24 it auto-corrects to 4,05E+26 :))) no idea what that is supposed to be …

It’s just “E-notation”, a commonly used compact form of scientific notation; 405E24 == 405 x 1024 == 4.05 x 1026 == 4.05E26 or 4.05E+26. Tell excel that the column is text when you import the csv. (Don’t know why you put a .xls extension on a CSV file)

1 Like

ah - yes - but no - my question was about ‘why’ excel this does without explicit request. xls extension simply because that way one has just to double-click to open file in excel - what works most often perfect.

try this workaround - and give me feedback …

change line 33 of script from (works for openoffice):

$csv .= "\"" . implode("\"\t\"", str_replace('.', ',', $value)) . "\"" . PHP_EOL;

to (works for excel + openoffice):

$csv .= "\"\t" . implode("\"\t\"", str_replace('.', ',', $value)) . "\"" . PHP_EOL;

or to (works for excel + numbers):

$csv .= "\"\t\0" . implode("\"\t\"", str_replace('.', ',', $value)) . "\"" . PHP_EOL;

edit: i added this (excel + numbers) to script in first post of this thread - so you could copy and paste the whole code too

Because spreadsheets usually deal with numbers?

absolutely - but i’d say from the crowd of excel users less than 1% deal with scientific notation?
so setting this as standard behavior is quite away from target group …

I changed it to the first suggested coding early this morning and will need to wait until tomorrow to see the result.

ok - so we’ll see tomorrow what the result is …
btw. when i see that you manually add the tail numbers - maybe you should read a little through these two threads

Thank you, the change worked, no more scientific formatting.

Thanks, I was only using FR24 and the call signs when I didn’t have a readable hex code, I don’t check the lot manually, my receiver picked up 1385 aircraft yesterday.

I haven’t even tried your initial database suggestion yet.

1 Like

perfect :slight_smile:

edit: in the last version of script i added the field you wished ‘squawk’ …

Thank you, I made the change this morning, just need to wait until 1am to see the differences on my setup.

1 Like

yes - but i made a mistake and now the bug was fixed but i accidentally left two colums ‘set’ in the script that were just meant for my debugging :frowning: i’ll delete this, add a test mode and maybe another datafield that could be of interest

sorry
tom

That’s alright, when I changed the code yesterday I forgot to reboot my Pi.

1 Like

sometimes two mistakes are better than one :slight_smile:

anyways - in first post now you’ll find the new script - lowest/highest signal strength is added to table. and from now no one has to mess around in the code to test the script - just set testmode to true - but when anything runs fine do not forget to reset to false before rebooting the pi to run from cron. now email option is default set to false - if you want reports delivered via email you have to set this to true.

maybe if i have time over the the weekend i’ll add another data column i had an idea about …

ok - here we go - the latest and greatest or horribly broken beta version. the (hopefully) stable version is in first post of this thread. this version here adds minimum/maximum distance of aircraft from user site location.

shifted this version to start post to stable: Daily Log/E-Mail Aircraft Report directly on your RaspberryPi