News:

Registered a URL and setup a forum as the IPCam stuff really needed its own site vs my irregular blog posts about IPCam hacking at http://www.computersolutions.cn/blog

Author Topic: Multiple relay on off  (Read 10708 times)

  • No avatar
  • *
March 03, 2014, 05:39:09 pm
Looking into the manuals and other papers about how the ipcam works, imptrying to find a way to do the next:
In a mobil or in a pc browser the ipcam sends a webpage in html format, and in both views you get a botton to turn on and off a relay that activates a relay, in the back of some models you  find an output to wire a device, and when you touch the botton in your browser or your mobil, the ipcam turns on the internal circuitries and shows a 5 volts in the alarm output of the ipcam. What im trying to do , is to modify the webui so there will be two or several bottons that could activate several numbers of pinout so for the user wil be possible to activate or desactivate  those outs or ralay. sumarazing, the user can turn on or off, lights, machines, or any valve that is connected to the ipcam., having 4 bottons extra in the browser, and 3 extra out to connect them to the devices. Looking in to the cgi comands the :

<img id="switchon" src="images/switchon_up.gif" onclick="decoder_control(IO_ON)" title="undefined">

<img id="switchoff" src="images/switchoff_up.gif" onclick="decoder_control(IO_OFF)" title="undefined">

commands, so ou can switch on or off the output relay, i need to find the way to modify the webui to place the others 3 outputs gifs or jpgs for those outputs, but i need also the way to modify the basic configuration of the nuvoton in the cgi part, to accept those new orders, like :
decoder_control(IO_ON)and decoder_control(IO_OFF)

to
deco1 on
deco1 off
deco2 on
deco2 off
deco3 on
deco3 off
deco4 on
deco4 off

Any ideas??

  • ***
March 03, 2014, 07:30:02 pm
Looking into the manuals and other papers about how the ipcam works, imptrying to find a way to do the next:
In a mobil or in a pc browser the ipcam sends a webpage in html format, and in both views you get a botton to turn on and off a relay that activates a relay, in the back of some models you  find an output to wire a device, and when you touch the botton in your browser or your mobil, the ipcam turns on the internal circuitries and shows a 5 volts in the alarm output of the ipcam. What im trying to do , is to modify the webui so there will be two or several bottons that could activate several numbers of pinout so for the user wil be possible to activate or desactivate  those outs or ralay. sumarazing, the user can turn on or off, lights, machines, or any valve that is connected to the ipcam., having 4 bottons extra in the browser, and 3 extra out to connect them to the devices. Looking in to the cgi comands the :

<img id="switchon" src="images/switchon_up.gif" onclick="decoder_control(IO_ON)" title="undefined">

<img id="switchoff" src="images/switchoff_up.gif" onclick="decoder_control(IO_OFF)" title="undefined">

commands, so ou can switch on or off the output relay, i need to find the way to modify the webui to place the others 3 outputs gifs or jpgs for those outputs, but i need also the way to modify the basic configuration of the nuvoton in the cgi part, to accept those new orders, like :
decoder_control(IO_ON)and decoder_control(IO_OFF)

to
deco1 on
deco1 off
deco2 on
deco2 off
deco3 on
deco3 off
deco4 on
deco4 off

Any ideas??

There are 4 pins exposed when the pins are exposed. Two pins are for +5V DC High/Low and the other 2 pins are for Open/Closed circuit.

Therefor you could have 4 unique conditions. Realizing that they will be the exact opposite when the camera is in an alarm state. However even that can be disabled and still allow the I/O to be used independent of the IP Camera alarm state. Meaning that you can define the ("At Rest") state of these pins during non-alarm pins.

I have a free interface that exposes these settings when using a Admin Level User Id with the interface:

http://foscam.us/forum/free-generic-browser-interface-for-foscam-ip-mjpeg-cameras-t2522.html#p10970:

Unique Conditions at rest:

Open circuit & 5V DC
Closed circuit & 5V DC
Open circuit & 0V DC
Closed circuit & 0V DC

Don

« Last Edit: March 03, 2014, 07:33:00 pm by TheUberOverLord »

  • No avatar
  • *
March 04, 2014, 12:04:42 am
tnks for your comments. It is true, there are those connections with http://i59.tinypic.com/34o6nnk.png


on cameras back, with 5 v out when the relay on the webui its set.

But my idea is this:



http://i58.tinypic.com/29vdwp.jpg

To put in the camera 3 more out connected to the correct out inside the microcontroller, and also modify the webui to have those new bottons, and also for the mobile device:;

<a href="http://es.tinypic.com?ref=289lpk" target="_blank"><img src="http://i58.tinypic.com/289lpk.jpg" border="0" alt="Image and video hosting by TinyPic"></a>


http://i58.tinypic.com/289lpk.jpg
http://es.tinypic.com/r/289lpk/8

So the user will be allow to activate 4 relays at home, and no t only one as the factory made.

There are a lot of thing to do, so im searching the outs that are turned on when you push the botton that the webui has, and when i find it i will need some good help to modify the webui, the apk apps, and the base programming codes from the kernel of the camera.

Hope to be clear with thise project.
Lets start, any clues?

  • No avatar
  • *****
March 04, 2014, 01:47:27 am
HI,
a) the 5V output is no "output". It is an input pulled high via resistor, so the usual "open collector" output of any alarm device can pull it to ground and thus activate the alarm of the camera (instead of e.g. the motion detection).

b) you would be able to multiply the activator elements in the webui but won't be able to multiply the relay output as the "connecting logic" is in a closed source proprietary single binary.

conclusion: the only way to add some outputs would be via e.g. an arduino board listening to the serial port of the camera which you can control via modifications to the webui. Alternatively you can improve the open-ip-camera-software and bring it from some alpha to beta to have at least the ex factory (not only rudimentary) functionality ammended with your additions...

  • ***
March 04, 2014, 03:26:02 am
HI,
a) the 5V output is no "output". It is an input pulled high via resistor, so the usual "open collector" output of any alarm device can pull it to ground and thus activate the alarm of the camera (instead of e.g. the motion detection).

b) you would be able to multiply the activator elements in the webui but won't be able to multiply the relay output as the "connecting logic" is in a closed source proprietary single binary.

conclusion: the only way to add some outputs would be via e.g. an arduino board listening to the serial port of the camera which you can control via modifications to the webui. Alternatively you can improve the open-ip-camera-software and bring it from some alpha to beta to have at least the ex factory (not only rudimentary) functionality ammended with your additions...

Could you have a different IP Camera model?

At Rest State = IP Camera idle not in alarm state.

Because, as you can see here. For (a). There is no power source required to drive this light/sound alarm. When the IP Camera goes into an alarm state. It's the 5V DC pin from the IP Cameras ("Output") going high that provides this device power. When the at rest state of those pins is set to 0V DC ("Low") when the IP Camera is not in an alarm state:



Note: Notice Pins 1&2 ("Output") being used above.

From: http://www.ebay.com/itm/Special-Monitoring-sound-and-light-Alarm-1-5m-cable-Security-IP-camera-/320877293964?pt=LH_DefaultDomain_0

For the other two pins (b) creates a closed or open circuit using for example door magnets:



Note: Notice Pins 3&4 ("Input") being used above.

http://www.ebay.com/itm/NO-NC-Magnetic-Door-Alarm-Sensor-Detector-IP-CCTV-Security-Camera-/220814240891?pt=UK_Safety_Alarms

This is the way all my MJPEG based IP Camera models work that have the 4 pins exposed. I also have used both of the devices above with them.



I can also ("Using the Web UI with my Web UI Interface when using an Admin User Id for the IP Camera that I mentioned in my prior post here") to for example. Allow the door closing or opening to cause the IP Camera to alarm or the light/alarm to be on when the IP Camera is idle or in alarm state. Based on what at rest state ("Low or High") I set both sets of pins ("Input and Output") when using that Web UI Interface to do so.

Additionally. Based on the checkboxes for "IO Linkage" and "Input Armed" it's possible to in real-time change the at rest state to ("Low or High") for one or both input and output. Without the IP Camera being required to go into an idle or alarm state. So that one can use input output for whatever is needed. As separate stand-alone interfaces. Without directly tying them to a IP Cameras idle or alarm states or being effected by those IP Camera states, when they change.

Example: I could use both sets of pins (a) Turn a coffee pot on and keep it on when there was 5V DC ("Using some special interface of course") and (b) Unlock a door using an electric interface for that electric door opener. That would do so when it had a closed circuit. Without any cause or effect of the IP camera being in a idle or an alarm state or those things changing if the IP Camera were to go into an alarm state. By simply changing in real-time. The at rest state ("Low or High") values of the pins ("input or output") by using the software Interface. Which would not change the IP Cameras alarm state while doing so.

There is one downside of using the input output interfaces. In some cases the input output settings revert to default settings when the IP Camera reboots depending on the IP Camera model. This means one may need some mechanism to quickly and accurately determine when and if the IP Camera reboots if one uses different input output settings then the default input output settings at reboot time.

One can use my Interface to quickly determine if your IP Camera model has this issue because after reboot you can see that whatever values you may have set for input output values have changed.

Personally. I am not aware of any easy methods to change this when/if it's happening. I have often wondered if there is a byte area in the params memory area that's normally used for IP Camera dynamic configuration values and configuration backup files. That could be modified to stop this from happening or at least to force the defaults to use your defaults vs. the normal defaults. Not sure if that byte area is actually a part of that byte area however. If it is, it's not normally being changed. When input output settings are changed as it is when you add an email address in the cameras configuration, for example.

Don
« Last Edit: March 04, 2014, 05:43:32 am by TheUberOverLord »

  • No avatar
  • *
March 04, 2014, 09:22:50 am
Ive been using optocouplers in the 5 volts out, and added and upstream detector, so when you push the botton the circuit turns on, and off when you touch the icon off in the browser. So far has work with one device connected to the out. But i want,as i said, two or more devices been controller by the user in the webui, so to do that it is necessary to do a lot of work. As schufti points, i need some modification in the main c core program. Also so to some wiring, welding some cables, optos and relays, but its easy. The hard thing its to change the main program and the compile. So if i can not reach the main program so its goin to be mission imposible. Any solution you may have?

  • No avatar
  • *****
March 07, 2014, 01:42:27 am
ok, so your cam is a new generation where they finaly cut cost for the relay too (as I recognized from your pictures)....

again, conclusion: the only way to add some outputs would be via e.g. an arduino board listening to the serial port of the camera which you can control via modifications to the webui.
« Last Edit: March 07, 2014, 01:48:06 am by schufti »

  • No avatar
  • *
March 10, 2014, 01:01:10 pm
schufti  :   

Understanding that? Is it possible to receive orders through the remote webui? where should i start to look? in that case, is it necessary to modify just the webiu or also the linux boot? you mean that sending cgi commands shows the interaction between the remote user and the seria out of the camera? And if it so, how is it done?

  • No avatar
  • *****
March 11, 2014, 09:18:26 am
a) yes you have to modify the webui to accomplish this
b) yes via cgi-sdk it is possible to give output via the serial port.
c) look for cgi-sdk in the download section, find the "magic words" and do a board search

hint: to get results from all sections you have to be at the portal of the board when starting the search...

  • No avatar
  • *
March 14, 2014, 10:41:10 pm
ok, i will do some research and post re results


Thanks