for 2 years i have 2 plugwise usb sticks which as a kind of zwave contoller communicate with plugwise circles to measure power consumption of ac 220 devices and to switch the device on or off. one plugwise stick is local and one is on a remote location which should communicate via the www.
i want to use one usb stick on a remote loacation, but al the usb to tcp devices i have dont function over www, but i also have a digi 4ts serial port server which works perfect with zwavve on a remote location.
so is it possible to use the spider with a usb host module and a serial module to pass the data through to both sides ?
then i can use the serial module to connect to the serial port server and my problem is solved.
and i have found then a use of the spider to function as a not existing device yet.
I don’t know exactly the connection scenario you’re thinking of, can you explain it a bit more? From the product page I assume what you want to do is to extend the zigbee network by using the internet - so you have two plugwise sticks, talking to multiple plugwise plug modules, some on the other side of the “network”, and they are all treated as one big network even though the second zigbee/plugwise network is remote?
Have you tried connecting the plugwise device to the Spider? Use the USB helper on the codeshare to see what endpoints it presents and report back !
the scenario is as you have put it in words. plugwise uses the wellknown ftdi chip for uart usb. i dont think that would be a problem , more if the rs232 serial module can be used as a client for the digi serial port server.
i try to make a kind of datareceived eventhandler for the USBH_SerialUSB instance. to watch if something is fired by the plugwise stick.
i came to this but i cant find any members of GHIElectronics.NETMF.USBHost.USBH_SerialUSBEventArgs
i came to this sofar
void serialdatareceivedEvent(object sender, GHIElectronics.NETMF.USBHost.USBH_SerialUSBEventArgs e )
{
int count = 255;
byte[] b = new byte[count];
serialUSB.Read(b, 0,count);
}
You need to poll USB serial ports, you cant use a datarecieved event handler.
Otherwise, sounds like thinks might work out ok for you from talking to the control stick (as long as you can figure out what commands it’s sending). Then you need to figure out how you’re going to send commands over the network - are you going to have two Fez devices? Or can your serial port server handle internet?
the digi 4 ts portserver has 4 serial ports and one ethernetport for the internet, the receiving computer has a digi virtual serial realport which connects to a serial port on the serialportserver.
i use one spider , the usbhost atteched to the plugwise usbstick and the serial port to the serialportserver.
i can program serial ports but usb is new for me.
sending “hello world” to the plugwise stick gives 10 bytes in return. nothing happens without a send string.
GHI Electronics – Where Hardware Meets Software has the code you need to handle the serial connected USB device (ie your control stick). Specifically, the section “Serial devices” has the actual code you’ll want to review and understand, because you’ll be able to use a lot of it. In your scenario, the USB device is just a serial device. Figuring out what to send it to “do stuff” is the bit that will be interesting for you (and if you already know that, awesome!). Then I guess you have to figure out how to send the command that the stick sends in and figure out how to relay it out to the serial port server over it’s internet interface.