create a dialtone from 56k modem - c#

Ok, everybody get in your wayback machine. I need to have a phone dial into my computer's 56k modem. I need my computer to have the modem "on" and have an active dialtone.
Here is why:
I have a sump pump alarm that will call me on a pump failure. It only works with a landline. I want to stop paying for my landline to save money and just have my cell. My idea is to intercept the outbound caLL from my sump alarm on my pc's 56k v90 modem. Then I can text message, email,etc... for free.
Does anybody know how to get started? I have found plenty of stuff on how to make outbound calls from my pc, but I want a phone (device) to dial my pc. I think the sump alarm will not dial unless it hears a dialtone.
I prefer a C# or vb6 program, but willing to go with anything. I have some experience working with serial comm devices so I just need to be pointed in the right direction.
Thanks!!!

You're going to need more than a modem in your PC to accomplish what you've described. Both the sump pump and your PC have modems, which are the subscriber end of a telephone "loop". The CO end (Central office in telephony terms) provides functions that you're telephone and both the modems mentioned above.
A big one is the generation of a ring ... this is a relatively high voltage AC signal that actually rang the bell in the old style telephones, but is simply detected in newer phones and your modems. In order for your sump pump's call to be recognized, this ring voltage has to be received at your PC's modem, but the sump pump won't actually generate this tone.
The other ideas presented here (the use of a PABX SOHO switch or connecting the detected signal from the sump pump directly to a I/O port on your PC), I can think of one other option. Somewhere inside the sump pump is a UART chip that does the serial communications to the included modem. If you disconnect the modem from the UART, you have the basics of a serial port, which can be connected to the serial port on a PC (though you may need an interface chip to get the levels right ... see the ICs provided by Maxim).
Good luck!

The easy way: Take a simple PABX (small SOHO kind) to let your alarm call your PC. You can use your PC's modem to wait for a RING from your modem. (Use the System.IO.Ports.SerialPort class to accoumplish this.) You'll need to program your alarm system to call the internal number of your PC.
Once you get a ring, you let your software do the rest.

Another option is a pySerial script written in Python.
You can write a small listener that listens for phone calls from your pump modem. You will need to know some AT commands, which you can look up anywhere online.
import pySerial
ser=serial.Serial('COM4',2400,timeout=1) #replace 2400 with your baudrate
ser.open()
ser.write("ATS0=1\r\n") #picks up after one ring
while(1):
line = ser.readline() #listen in a loop

I used to have a "Telephone Line Simulator" that allowed me to test modem configurations by letting one modem call another through a little black box that simulated the phone company's part of the bargain. Something like that should be easy to find, and would be an easy solution to your problem.

Do you need the sump pump to actually dial?
Can you not just intercept the sump pump's check for the dialtone?
Or better,
maybe there is an electronics friend you have who can wire up a simple device that plugs into the sump pump and checks for a voltage edge that occurs when the pump fails. This is an event preceding or concurrent with the pump actually trying to dial. When this little device detects the edge, it can then trigger something on your PC appropriately. The device might even be able to detect the V change on the telephone line - on the RJ11.

I don't know how familiar you are with electronics, but I almost wonder if your solution could be handled with a mix of software and hardware.
My first thought was to have something like an Arduino hooked up to either the circuit that does the pump failure detection or the phone line and watches for whatever signal the pump sends out. Arduinos are usually hooked up to your computer via serial/usb, and then you can have a piece of software that emails you, tweets at you, or whatever you want.
You could possibly have your modem watch for the pump trying to dial out, but I have no idea how you could do that.

I'd probably keep the two programs separate.
I'd have HyperTerminal (assuming you're on a Windows machine) running against your modem, with ATA or something similar, upon activity, I'd have it write a file.
I'd have another program running as an automated task (like every 30 minutes), looking to see if that file has been changed, and have that trigger a SMS message to your phone.
I'd imagine this would be a simple enough setup that it'd be easy to maintain, yet reliable enough to prevent your house from becoming a pool...

Related

Is there a way to send data over computers other than UDP and Bluetooth?

I want to make a simple desktop app that receives data from my phone and does certain stuff accordingly. I don't need to send any more than 1 byte. I tried UDP but it requires firewall bypassing which is a spooky popup to click on. I also tried Bluetooth but I couldn't get it to work because most of the documentation is about BLE not Bluetooth Classic. Is there any other way I can communicate with another device from a short distance even if I'm just limited to sending 1 byte? I would like topics to research but code samples are also welcome, preferably in C#.

Windows 8 Runtime (metro) Serial communication using Tera term?

For my senior design project, we have developed a Windows Store App to control a 2-player tug-of-war style game (all in software) which is controlled by the energy levels of each players EEG signals (specifically alpha/beta bands, relating to concentration levels) which we are transmitting over Bluetooth LE. We are also thinking about controlling a physical component to the game with an STM32F0 Microcontroller.
Basically, every so often (on some event trigger) we want to send a value between -100 and 100 in 2's complement to the uC to control the direction that the motor will move and it's speed. All the research I have done has suggested that Windows Store Apps do not support serial communication at all, but I was hoping there was a not-too-difficult workaround. We have a USB to serial adapter which will be able to communicate with the uC's UART. Is it possible to use something like Tera Term, where the Store app could communicate with the terminal upon some event and send the data over the serial port? Could the Windows App open tera term and write values to it? The communication need only be in one direction.
I'm open to suggestions on alternatives (aside from writing some custom driver, which would be too complicated for the amount of time that we have remaining to finish the project). Should we just completely abandon the prospect of serial communication and look into something like zigbee or bluetooth? I know it's possible to communicate over serial port using System.IO.Ports in a WPF/Windows Forms application but that is not an option at this point, since we have already developed the entirety of the host application (minus this serial comm). Thanks!!
EDIT 1: I'm considering using a UDP socket as a means of sending the necessary data to a background Windows Forms App which should be able to communicate over a serial port.
I don't think that network access to localhost is allowed with store deployed windows store apps. However Bluetooth serial port profile may be a possibility, judging by a quick google revealing this.
However, given that WPF has access to a rich library of IO communications support, and it is mostly a superset of WinRT, a port may be easier than you think.

Serial port does not receive data

first of all sorry for my english :)
I have a PCI serial ports card with 2 COM ports. I am using it to receive data from another computer via serial cables. (That other computer will be named as "Sender" subsequently)
The problem is, when cables are plugged in to my computer and i reboot (Windows 7),(Sender is still running...), then my PC does not receive any data. But when i reboot and after that I connect the cables in my PC it starts to receive. I temporary solved it by firstly starting my PC and then the Sender PC, but it's really a terrible solution...
I tried to connect my PC with a different computer (different sender), and it works good.
So I think that the problem can be with my main Sender. Maybe it is waiting for some signal from my computer that the ports are ready? Or Windows 7 can block my serial ports card (standard COM1 which is not on that card works fine) during reboot? Maybe I have to manually send some signal to Sender that I'm ready? By the way, I cannot, in any way, make adjustments to the Sender PC; only turn it on or off.
I do not have any expertise on serial ports so I really don't know what to do, or what I'm currently doing wrong.
Any ideas? (my receiver application is programmed in C#)
UPDATE: I forgot to mention that when the cables are connected... reboot... then ports can't be even opened.
This is a problem caused by the handshake signals. The Sender's DSR (Data Set Ready) is wired to your DTR (Data Terminal Ready). It will see the signal turn off when you reboot, now it gets sulky about sending anything because it thinks that you are no longer connected. You can exacerbate this problem by not setting the SerialPort.DtrEnable to true in your program, that's very commonly overlooked.
Same story with the RTS and CTS signals, if you set the SerialPort.Handshake property to anything else than Handshake.RequestToSend (the recommended value) then it now becomes your job to control the signal. You must set the RtsEnable property to true explicitly in your code.
It tends to work by accident, you're apt to use another program to test the connection. Like HyperTerminal or Putty, they'll turn the signals on for you and your program will now operate correctly.
This kind of bug could of course also exist in Sender. If you can't fix that code then all you can do is rewire the cable. Connect RTS to DSR and CTS on the Sender side to it will always see the signals turned on.
Problem was in card... I changed for new one and now its working correctly. Looks like the card was too old for Windows 7.

Hang up while dialing a phone number after firts bip using using ISDN modem (C#)

I want to hang up after modem finish dialing a phone number.
I can track when modem start dial and when it disconnect. But I can't track dial finished.
I use TAPI for it. I tried C# and C++. But I don't know how to manage it.
When a modem is dialing, it's normally just sitting there waiting for the other end to answer. TAPI can tell you when the dialing starts (because it sends the command to dial) and when the hangup occurs (because the modem reports "NO CARRIER"), and it can tell you when the other modem answers (because then the modem reports that it's connected), but the modem doesn't say when it's done dialing. (So-called "winmodems" might be able to do this, as they're run more by the driver than the hardware in the modem. But it's not something you can really rely on.)
This means that the only way you can really know is to have a modem that can feed the sound on the phone line back in through a mic or line-in or something (which also isn't exactly universal on a modem), and having some software listen for the touch tones and report when it hears a pause.

How to send data to another computer with C# like hyperterminal does through modem

I need to create a program that lets me send a string of data or a file through modem, like hyper-terminal does. Im trying to create a program that lets me send electronic billing data to Medicare, and since Medicare only accepts e-bills through modem, only hyper-terminal or another program called PC ACE Pro32 can be used.
I want to create my own program, since hyper-terminal is not user friendly, and the other program has too many things for just sending data.
I've never before had experience creating code for data communication. Can somebody please help me?
There are a lot of pieces here, so let me break this down into sub questions for you:
1) How do I do serial communication in C#?
There are plenty of examples on the internet. A quick search turns up this one and this one, both of which seem to be ok. There are also lots of questions here on SO about C# serial communication.
2) How do I control a modem?
Modems are operated by some version of the AT command set. If you're familiar with manually operating a modem in HyperTerminal, you're essentially doing the same thing, but in code. For example, to test if your modem is paying attention (i.e., that your serial line is talking to the modem properly), you send AT, and see if the modem replies with OK. To dial, you send the modem ATDT <phone number>. Once a modem establishes carrier, then whatever you send down the serial port is transmitted to the remote computer.
3) How do I communicate with medicare's electronic claims system?
This one is up to you! I'd be surprised if they didn't have a web-based claims service though. I would expect that would be a lot easier than doing it over a modem.
Define a receiving connection in remote computer.
Set up a connection to remote computer just like any dial-up connection.
Use socket programming (TCP) to send/receive data to/from remote computer. Note that you must create a client/server application that resides in both remote and local computer.
Seth, your answer is actually very promising. Ill be taking a look at those suggested links right away.
(yes, medicare should be moving to ethernet, but reality is that they are stuck in dialup because they say that "it's more secure than ethernet", when in reality it's not.

Categories

Resources