I noticed that my city exits are no longer showing up. They simply show up blank. This happens under WAN and VPN.
Thanks Viktor, I'll test launching from terminal when I get back home and report back.Really weird. Works for me immediately on start. I'm starting it from command line...not AMTM.
BlankAre they blank or do they show [n/a]?
No words.@Viktor Jaep well, I tested it, exiting vpnmon and then re-launching directly from terminal using vpnmon-r3 -screen and it came right up.
Found that strange, so I exited and re-launched via amtm and this time no delay either.
Exactly... That's probably what was blocking city name lookups.Noticed Skynet was blocking ip-api.com which is queried by the script to display ip information in the cli this might be related but not sure.
Here is the alientvault indicator link:
https://otx.alienvault.com/indicator/ip/208.95.112.1
Yeah, I got that from your initial post. That's why I did not say "the script is getting stuck forever within the main loop when gathering the data …" Only that the script appears to be getting "stuck" *while* gathering the data …Again, what it takes is waiting for 2 full cycles and then everything works as normal, as I indicated in my posts
I noticed that my city exits are no longer showing up. They simply show up blank. This happens under WAN and VPN.
Noticed Skynet was blocking ip-api.com which is queried by the script to display ip information in the cli this might be related but not sure.
...
Exactly... That's probably what was blocking city name lookups.
curl
cmd for specific "failure" strings, but most likely it's not handling NULL strings. I'll take a look while I'm fixing a minor issue that one of my cousins saw yesterday evening WRT incorrect elapsed time percentages when in the main loop.Thanks again, @Martinski! I really appreciate you continuing to look into this! I'm excited to take a look to see how you handled the invalid keypresses during the loop part. This has been a major frustration for me, especially in RTRMON. I hope I can duplicate your methods!I've submitted a PR to the 'develop' branch with the following fixes/improvements:
Ahem... "legitimate rounding errors"??The last fix is about showing 0% when the elapsed time was > 0 sec. This was recreated by setting the maximum loop timer to a large value (e.g. 600 sec.)
You're welcome. And, of course, feel free to reuse and port the code over to your other scripts. If you have any questions, you know where to find me.Thanks again, @Martinski! I really appreciate you continuing to look into this! I'm excited to take a look to see how you handled the invalid keypresses during the loop part. This has been a major frustration for me, especially in RTRMON. I hope I can duplicate your methods!
Yeah, the issue was indeed caused by rounding off to the nearest integer value due to the method used to calculate it. In your particular case, getting a floating point number with one significant decimal place is sufficiently precise and makes it more meaningful to the user (IMO), especially when the maximum loop timer is set to a value much greater than 100 seconds.Ahem... "legitimate rounding errors"??
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/VPNMON-R3/main/vpnmon-r3.sh" -o "/jffs/scripts/vpnmon-r3.sh" && chmod 755 "/jffs/scripts/vpnmon-r3.sh"
I got some free time this evening and started to take a look at porting the code from VPNMON-R3 to the RTRMON script to ignore invalid key presses within the timer loops, and I found a syntax error in aThanks again, @Martinski! I really appreciate you continuing to look into this! I'm excited to take a look to see how you handled the invalid keypresses during the loop part. This has been a major frustration for me, especially in RTRMON. I hope I can duplicate your methods!
...
printf()
call statement. Since the same error is also found in BACKUPMON & VPNMON-R3 scripts I've fixed that code and created a pull request on each GitHub repository. I also made a couple of minor code improvements.You must be mistaken! My code is 100% error free! LolI got some free time this evening and started to take a look at porting the code from VPNMON-R3 to the RTRMON script to ignore invalid key presses within the timer loops, and I found a syntax error in aprintf()
call statement. Since the same error is also found in BACKUPMON & VPNMON-R3 scripts I've fixed that code and created a pull request on each GitHub repository. I also made a couple of minor code improvements.
I'll continue to look at porting the code over to RTRMON.
FYI.
Oh yeah, "Bug-Free Code." The legendary mythical beast, long sought by hardened, battle-scarred developers as well as young novices eager to prove their true mettle. It's been seen only in brief moments, usually during long, energy-drink-and-coffee-laden marathon nights of frenzy coding sessions...You must be mistaken! My code is 100% error free! Lol
You mean the following error?Thanks @Martinski! I had been working on a key press suppression tactic for some time without luck. A known issue is especially repeatable in rtrmon... Directly after the 10sec loop, and before the loop starts over, it runs through a large set of calculations. During that brief window, if you hit "s", you can frequently make it terminate the script with a "malformed operator" error.
That pretty much sums me up to the T right there... LOLOh yeah, "Bug-Free Code." The legendary mythical beast, long sought by hardened, battle-scarred developers as well as young novices eager to prove their true mettle. It's been seen only in brief moments, usually during long, energy-drink-and-coffee-laden marathon nights of frenzy coding sessions...
That's the one!You mean the following error?
You are amazing! I can't wait to see how you approached this. I had always figured that because it's a shell script, that keyboard input was just inserting itself into the lengthy calculations running in the background during this time, and the insertion of just 1 character would throw off the math, giving these errors. I was looking for a way to prevent keyboard input altogether just to keep the calculations undisturbed, but never had any luck with that.Yeah, it's the first problem I found during my initial "testing & kicking-the-tires" session to see what problems existed by not ignoring invalid key presses during the timer loops.
I've found other issues as well. For example, when setting the "Timer Interval" option (while testing), the code was taking any user input with little validation (e.g. "0" or "X") and without lower-bound or upper-bound checking, so I was getting runtime errors such as "divide by zero" or "arithmetic syntax error."
Granted, users should know better and never enter invalid values but it's always better (and a recommended standard practice) to validate user input, no matter what.
Anyway, I've already fixed the above 2 problems so things are already working much better. After dinner, I'll run more testing & validation.
Well, that's not quite how the interactive session terminal input buffer works and, in this case, how it was causing the errors... I had always figured that because it's a shell script, that keyboard input was just inserting itself into the lengthy calculations running in the background during this time, and the insertion of just 1 character would throw off the math, giving these errors.
curl --retry 3 "https://raw.githubusercontent.com/ViktorJp/VPNMON-R3/main/vpnmon-r3.sh" -o "/jffs/scripts/vpnmon-r3.sh" && chmod 755 "/jffs/scripts/vpnmon-r3.sh"
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!