 |
|
 |
Hi Brett. I just finished modifying your code to add support for the Arris Touchstone cable modem. I kept the code you had and added a check for the string "Touchstone" in the returned HTML code...then did the parsing properly for that modem.
Would you want this code?
I also had to enable useUnsafeHeaderParsing to be able to talk to the Arris modem.
Steve
|
|
|
|
 |
|
 |
I would like to have a version of it made that supports them.
|
|
|
|
 |
|
 |
Hello,
I have a quick question. I can read the logs accessing the modem web page through a wireless router connection. When I run the CableModem program I get the graphic (no data)and an error message "Unable to contact host, is the cable modem plugged in?"
Will the program read the modem logs through a wireless router, or it needs to be wired directly to the modem?
Thank you ,
KG4REQ
|
|
|
|
 |
|
 |
If you're running the program from the same machine you're running the browser on, then double check and make sure your cable modem's ip is correct in the program. My cable modem is at 192.168.100.1, yours may be somewhere different.
I've found some hosts/routers have trouble understanding that the 192.168.100.1 is technically outside of your router since 192.168.0.0 is inside, but again if you can get it in your web browser on the same machine, it should work.
If you're running Vista, it's possible the program got blocked by the firewall. Check in the firewall exemptions setup. Also try right clicking the app and do "Run As Another User", and use Administrator.
Let me know if I can do anything else.
|
|
|
|
 |
|
|
 |
|
 |
parent appears to be spam.
|
|
|
|
 |
|
 |
At the time, I wrote this to be a quick and dirty way to log my data, I did not put much effort into doing this the best way possible. Furthermore, C# has come a long way since this was written and treating the page as XML and using LINQ or somesuch may be a far better way to parse it. While I do not intend to update the code at this time, I thought it worth nothing that this is not so much an example of coding as an offering of a utility.
|
|
|
|
 |
|
 |
Thanks for the .exe file. However, my Surfboard monitoring program requires me to login (UserID: admin, Password: motorola). How can I be logged in to use your program?
I have tried logging in and having the standard monitoring program (http://192.168.100.1/cmSignal.htm) open and running while activating your .exe. I still get the error message "Unable to Contact Host . . ." Is there any help you can offer?
|
|
|
|
 |
|
 |
If it's just simple HTTP auth and not some cookie magic thing.. around line 320, add the Credentials line
try
{
wc.Credentials = new System.Net.NetworkCredential("user", "pass");
data = wc.DownloadData("http://192.168.100.1/signaldata.html");
}
change user and pass as appropriate.
|
|
|
|
 |
|
 |
I keep getting a window popping up with "Unable to contact host, is the cable modem plugged in?"
I have some ideas, (like adding a snippit to output the value of "data" to see if it is even getting information assigned to the variable) but I don't know how to compile with multiple files and directories(Never got that far) Would it be possible for you to post what you type to compile the code?
Thanks in advance for any help. I can follow much of this but I only learned the basic single file lvl C++ so this is pushing my knowledge.
EDIT:
Ok, so this is where I am currently
After some reasearch I am have landed on this as the compile command
(not that mcs is taking the palce of the normal csc because I am using a compiler called mono and that seems to be their version of the compile command)
C:\c\cm>mcs assemblyinfo.cs form1.cs
What I am supposed to get (this according to the tutorials I am using to work my way through this) is a executable file that takes the name of which ever file has the Main() method, in this case form1.cs. But instead of the expected form1.exe, I get the following.
form1.cs(14,23): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings
So I've made a little progress here but am once again at a loss. I've looked up the error CS0234 and it is called a namespace error. I've found a few sites with information but the examples and how I can apply them to this code arebeyond my current knowledge. If anyone has the chance, any help would be appreciated.
-- modified at 2:00 Monday 22nd January, 2007
|
|
|
|
 |
|
 |
I've not been to this site in a while, just now (many months later) caught your message. The unable to contact host message is just telling you it wasn't able to make an HTTP connection to 192.168.100.1. If you don't have a surfboard modem, or perhaps have a newer one or different fimware, yours may not be on the same IP.
As far as compilation goes, I always just use Visual Studio and I can't say that I've ever compiled C# code manually.
I'm also unusure what you meant about adding a snippit of output.
Sorry for the delay!
|
|
|
|
 |
|
 |
form1.cs(14,23): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings
That one, if for some reason System.Windows has been removed, you'll have to add it back. Right click the References in Solution Explorer under the CableModem project and Add Reference- find System.Windows and add it.
|
|
|
|
 |
|
 |
Brent.
I am having some SNR issues with my surfboard and wanted to continuously monitor it. A web search took me back to the good ol' Code Project. Your program was just what I needed, except at home, where I didn't have VS. So I downloaded and installed the Express edition of VB, converted your code with one of the free C# to VB converters and with just a few tweaks I'm up and running. Now all I have to do is wait for the cable company to fix my noisy line.
Thanks,
Tom
|
|
|
|
 |
|
 |
Glad it has been of some use. It got our line fixed- we were getting dropped off about once a day for a few hours and it got really old. The tech would come and things would be fine, so the first two times they just left (not believing me or something), the next they tried harder but still didn't really find anything, which was when I wrote this app. I did some logging for a while, captured some great dips and spikes, and printed a graph in excel. When the next guy came, I think he believed me, but still couldn't find anything. They left, I gave up, and magically about 2 weeks later, everything resolved on its own. Our tv picture is still a little less crisp than you'd think it should be for cable, but it's not bad, and our internet has been solid for months with the rare outage due to local activity. Anyway, hope this improves things for you and gets the job taken care of.
|
|
|
|
 |
|
 |
Interesting. Mine varies with the time of the day. Good during the day till about 2 hours after sundown. Then out until sometime after sunrise. I'm wondering about temerature or humidity on some outside connection. Bet it takes some time to resolve.
|
|
|
|
 |
|
 |
It's definitely possible that the heat during the day is expanding the cable and pushing the wire inside past a corroded or dented spot to where it actually makes contact and when it cools off, it moves back to the bad spot. They replaced the little grounding coupler just outside where it enters my house because that had some corrosion on it- who knows if it helped since it didn't immediately resolve the problem, but it could have been one of several factors. Best of luck to you.
|
|
|
|
 |
|
 |
Add this code block and then create a label in a group box at the top and this will get the cable modem's current status string. private string fetchStatusString() { try { byte[] data; System.Net.WebClient wc = new System.Net.WebClient(); data = wc.DownloadData("http://192.168.100.1/startupdata.html"); string result = System.Text.Encoding.ASCII.GetString(data).ToLower(); bool flagnext = false; int idx = 0; int idr = 0; while (idr != -1) { idr = result.IndexOf("<td", idx); if (idr == -1) continue; idr = result.IndexOf(">", idr); if (idr == -1) continue; int idrx = result.IndexOf("</td", ++idr); if (idrx == -1) continue; string tmp = result.Substring(idr, idrx-idr); idx = idrx; if (tmp.Length == 0) continue; if (tmp.IndexOf(">", 0) != -1) continue; if (tmp.IndexOf("\n", 0) != -1) continue; if (flagnext) return tmp; else if (tmp.CompareTo("cable modem status") == 0) flagnext = true; } throw new Exception(""); } catch { return "error"; } }
|
|
|
|
 |
|
 |
Hello, I have a related problem with cell phones.
Maybe you can help me is this.
Do you know how to start a call on a cell phone attached to the PC, I'm not talking about VoIP. I simply need to start a call giving the phone number from the PC.
Thanks anyway.
You can e-mail me at solodejazz[at]hotmail.com.
GiveMeJazz
|
|
|
|
 |
|
 |
Unfortunately, almost all cell phones behave differently.
With my phone, at one point, I could simply dial atdt and the phone number and it would place a voice call.
Google around and find the pdf's for your phones chipset and/or at commands. Perhaps there is an atdv (dial voice) type command.
|
|
|
|
 |
|
 |
Finally.. I got my server up.. so here ya go
http://www.webtrotter.com/cablemodem.tar.gz
I didn't have zip available, hopefully you can extract that. If not, you can download WinRar from www.rarsoft.com which will do tar.gz's.
|
|
|
|
 |
|
 |
Thanks, Brett! I'll give it a whirl.
Mark Siegel
|
|
|
|
 |
|
 |
So, if I don't have .net, how would one build/use this app?
C. Gilley
Will program for food...
My son's PDA is an M249 SAW.
|
|
|
|
 |
|
 |
I, too, would like to learn how to build/use this app? Thanks!
M. Siegel
|
|
|
|
 |
|
 |
The compilers are available for download without needing to have VS.NET.
It is not terribly complicated, but is a pain nonetheless.
I've been trying to decider whether to post an executable or not- only because of the prevalence of virii and whatnot. While my system is scanned regularly and clean, I don't want to be responsible for the file once it leaves my hands.
I think however, I will go ahead and post an executable that should work as long as you have the .NET framework (1.1) installed. [Update: can't seem to edit the article and upload the file?]
|
|
|
|
 |
|
 |
Thanks for your assistance. As a non-programmer, I really appreciate it!
-Mark
|
|
|
|
 |