General Discussion
  >> Fibre Broadband


Register (or login) on our website and you will not see this ad.


Pages in this thread: 1 | 2 | 3 | 4 | 5 | 6 | [7] | 8 | (show all)   Print Thread
Standard User deleted
(deleted) Sun 06-Jan-13 21:15:04
Print Post

Re: Huawei HG612 - Graphing - A cry for programming help


[re: R0NSKI] [link to this post]
 
In reply to a post by R0NSKI:
I've shifted the programs including the ini file to the scripts folder, but it's still leaving the isrunning file and it doesn't generate graphs when I run current_stats.



Do you mean there are multiple instances of ISRUNNING clocking up?
Are there any clues in the error log?
It should be found in the same folder as modem_stats.log.

It should look something like this, with the ISRUNNING file being deleted at the end of HG612_stats.exe:-

Text
1
23
45
67
89
1011
1213
1415
1617
1819
2021
2223
2425
2627
2829
3031
3233
3435
3637
3839
4041
4243
4445
46
06/01/2013 21:06:00.040 - [ IN HG612_stats.EXE ] - Start of 1 minute sampling
06/01/2013 21:06:00.040 - Temp File ISRUNNING-210600-040 was created06/01/2013 21:06:00.041 - malloc() O.K.
06/01/2013 21:06:00.041 - Initializing Winsock06/01/2013 21:06:00.043 - WSAStartup() SUCCESSFUL!!!
06/01/2013 21:06:00.043 - Starting getaddrinfo()06/01/2013 21:06:00.043 - getaddrinfo() O.K.
06/01/2013 21:06:00.043 - Starting socket()06/01/2013 21:06:00.047 - socket() O.K.
06/01/2013 21:06:00.047 - Starting connect()06/01/2013 21:06:00.048 - connect() O.K.
06/01/2013 21:06:00.850 - About to reply(xdslcmd info --stats)06/01/2013 21:06:00.850 - reply(xdslcmd info --stats) O.K.
06/01/2013 21:06:01.062 - get_data() O.K.06/01/2013 21:06:01.062 - About to determine the xDSL mode
06/01/2013 21:06:01.062 - About to parse_stats()06/01/2013 21:06:01.063 - parse_stats completed
06/01/2013 21:06:01.063 - VDSL2 mode detected so about to reply(xdslcmd info --pbParams)06/01/2013 21:06:01.063 - reply(xdslcmd info --pbParams) O.K.
06/01/2013 21:06:01.271 - get_data() O.K.06/01/2013 21:06:01.271 - About to parse_pbParams_data()
06/01/2013 21:06:01.271 - parse_pbParams_data() completed06/01/2013 21:06:01.271 - About to exit Busybox
06/01/2013 21:06:01.271 - Busybox exited06/01/2013 21:06:01.471 - About to exit ATP
06/01/2013 21:06:01.472 - ATP exited06/01/2013 21:06:01.477 - About to get_log_data()
06/01/2013 21:06:01.933 - About to calc_ES_delta()06/01/2013 21:06:01.934 - About to calc_RSCorr_delta()
06/01/2013 21:06:01.935 - About to calc_RSUnCorr_delta()06/01/2013 21:06:01.935 - About to calc_RS_delta()
06/01/2013 21:06:01.936 - About to calc_OHF_delta()06/01/2013 21:06:01.936 - About to calc_OHFErr_delta()
06/01/2013 21:06:01.937 - About to calc_HEC_delta()06/01/2013 21:06:01.937 - About to calc_CRC_delta()
06/01/2013 21:06:01.938 - About to calc_FEC_delta()06/01/2013 21:06:01.938 - Appending data to MSLOGFILE.log
06/01/2013 21:06:01.938 - Closing MSLOGFILE.log06/01/2013 21:06:01.939 - END of 1 minute sampling
06/01/2013 21:06:01.939 - About to close(sockfd)06/01/2013 21:06:01.939 - About to freeadddrinfo(res)
06/01/2013 21:06:01.939 - About to WSACleanup()06/01/2013 21:06:01.939 - About to free(txbuf)
06/01/2013 21:06:01.939 - About to free(rxbuf)06/01/2013 21:06:01.939 - End of HG612_stats.exe program, closing ERROR.LOG
06/01/2013 21:06:01.939 - ISRUNNING-210600-040 DELETED


Just thinking the only time you really need to to run current_stats is when the modem re-synced as thats the only time they will change iirc.

Not quite.
Hlog & QLN remain as static data until the next resync.
Bitloading & SNR are dynamic throughout the duration of a connection.

I'll send you a version with progress output echoed to screen that might give us a clue as to where things are getting stuck.


I can't recall now, but are you using an OS something like Windows Server 2012?

Would it not be possible for the get stats exe to run current_stats when it see's the up time has reset, thus automatically logging those stats after every re sync?

That's a thought that I might try to implement.
Standard User deleted
(deleted) Sun 06-Jan-13 21:27:05
Print Post

Re: Huawei HG612 - Graphing - A cry for programming help


[re: deleted] [link to this post]
 
In reply to a post by BatBoy:
I wouldn't do it, it just looks too hard for little benefit. For instance, what if the isrunning file doesn't get deleted?


This is from the error log:-
06/01/2013 21:06:00.040 - Temp File ISRUNNING-210600-040 was created
and another entry when it is deleted (assuming the program completes properl:-
06/01/2013 21:06:01.939 - ISRUNNING-210600-040 DELETED


Each time ISRUNNING is created it adds a time stamp to its filename.
That COULD be useful for if the program crashed BEFORE it had chance to build up a complete error log & as a novice in this programming malarky, I thought it to be one way of determining things.

I used "tasklist" in the later scripted versions, but I don't know its equivalent in 'C'
Standard User deleted
(deleted) Sun 06-Jan-13 21:37:24
Print Post

Re: Huawei HG612 - Graphing - A cry for programming help


[re: deleted] [link to this post]
 
Well, I guess you could interact with Windows using some win32 calls but that wouldn't be portable and, selfishly I'm interested in lean and mean code which is quick to execute.


Register (or login) on our website and you will not see this ad.

Standard User deleted
(deleted) Sun 06-Jan-13 21:46:30
Print Post

Re: Huawei HG612 - Graphing - A cry for programming help


[re: deleted] [link to this post]
 
In reply to a post by Bald_Eagle1:
If you have any other suggestions (in 'C') for checking if a given program is still running, please speak up as I don't know how to do that.

I'd create a file but then use file locking to check if the program is already running. I.e. create a file if it doesn't exist yet, then try to lock it.
The advantage is that if the program crashes the OS will remove the lock automatically.
In Unix/Linux/BSD/MacosX this would mean calling flock(). Figuring out what the Windows equivalent is will be left as an exercise to the reader because I have never done any Windows programming and I have no plan to start in the next 1000 years.
Standard User deleted
(deleted) Sun 06-Jan-13 22:10:52
Print Post

Re: Huawei HG612 - Graphing - A cry for programming help


[re: deleted] [link to this post]
 
http://en.wikipedia.org/wiki/File_locking
Microsoft Windows uses three distinct mechanisms to manage access to shared files:

using share access controls that allow applications to specify whole-file access-sharing for read, write, or delete
using byte-range locks to arbitrate read and write access to regions within a single file
by Windows file systems disallowing executing files from being opened for write or delete access

etc..

Edited by deleted (Sun 06-Jan-13 22:12:14)

Standard User Chrysalis
(eat-sleep-adslguide) Mon 07-Jan-13 02:10:00
Print Post

Re: Huawei HG612 - Graphing - A cry for programming help


[re: R0NSKI] [link to this post]
 
bitloading can change during a sync (bitswapping).

are we sure everything else never updates?

BT Infinity 2 Since Dec 2012 - Estimate 65.9/20 - Attainable peak 110/36 - Current Sync 71/20
Standard User Chrysalis
(eat-sleep-adslguide) Mon 07-Jan-13 02:12:33
Print Post

Re: Huawei HG612 - Graphing - A cry for programming help


[re: deleted] [link to this post]
 
please try not to overcomplicate the app.

I was expecting you to just make a master ini file to set paths and then distribute the app portable.

the current older app batch file used to enable the task schedule was neat, and I dont see a reason for you to change the batch script system for that.

BT Infinity 2 Since Dec 2012 - Estimate 65.9/20 - Attainable peak 110/36 - Current Sync 71/20
Standard User R0NSKI
(experienced) Mon 07-Jan-13 06:40:05
Print Post

Re: Huawei HG612 - Graphing - A cry for programming help


[re: deleted] [link to this post]
 
Yes, multiple copies of isrunning stacking up - I added a batch file to delete them on the hour, well 30 seconds past so it doesn't delete the current one wink

Doesn't seem to be a log file, could be just me having just got out of bed.

I'll have to leave testing the file you emailed me until tonight, data should be uploaded to dropbox just after 7am

Edit. Forgot to add it's Windows Home Server 2011, which is based on Server 2008 IIRC

Edit again.Also forgot to change the path for the modem log from the exe folder, so correct graphs have not been generated - must leave for work now.

Edited by R0NSKI (Mon 07-Jan-13 07:16:25)

Standard User deleted
(deleted) Mon 07-Jan-13 09:17:07
Print Post

Re: Huawei HG612 - Graphing - A cry for programming help


[re: Chrysalis] [link to this post]
 
In reply to a post by Chrysalis:
please try not to overcomplicate the app.

I was expecting you to just make a master ini file to set paths and then distribute the app portable.

I'm trying hard to keep it as simple as possible for all users (including me!).

Some users did need to manually edit the batch file scripts to suit their personal preferences such as removing the "Press a key to continue" type stuff in order to automatically schedule the generation of logs and graphs or just the logs etc. etc.

The new programs operate quicker, but any individual configuration requirements now have to be set in the ini file (unless manually typing in potentially very long lines at a command prompt etc.).


For many users, the default settings will suffice, but I have had to start allowing for users to configure things somehow or other.

This is a work in progress, so it may take a while for it to suit everyone as further configurable options may/will need adding accordingly & other tweaks may be needed to suit the majority of the different Windows systems being used.




the current older app batch file used to enable the task schedule was neat, and I dont see a reason for you to change the batch script system for that.

I intend to keep that, or at least something very similar.

Edited by deleted (Mon 07-Jan-13 10:59:48)

Standard User StephenTodd
(committed) Mon 07-Jan-13 16:12:32
Print Post

Re: Huawei HG612 - Graphing - A cry for programming help


[re: deleted] [link to this post]
 
All looking good for me. Much quicker and cleaner than the old code.
I had to change the .ini file around a bit to get things to fit with my experimental setup.

I assume the Ongoing_Stats\modem_stats.log file is exactly compatible with the previous version?
It appears to be from my quick tests.

That's the start of an attempt (not yet implemented) to determine if HG612_stats.exe is still running at the same time as say, HG612_current_stats.exe is started.
The modem doesn't seem to like 2 simultaneous login attempts.

By convention, such a file should be called '.lock'.
The 'isrunning' files are being cleaned up fine for me.

--
Moved (with trepidation) to BT Infinity 2 for upload speed. Happy BE user for several years.
Pages in this thread: 1 | 2 | 3 | 4 | 5 | 6 | [7] | 8 | (show all)   Print Thread

Jump to