OK, cool, you have a grand idea and a plan to somewhat handle the interactions… no more questions there from me (I’m not an XBee guy, so you’re talking above my pay grade
)
There’s lots of “com” ports in use in all this - perhaps we need to be explicit about what they all are. COM1 on the PC and COM1 on the Cerb are totally different ports, and it’s more random chance than design if you were talking from COM1 on one to COM1 on the other - so lets call them cerb-com1 and pc-com1 for clarity.
So in your first diagram, the “working” scenario is what you have right now, correct? Talking over debug.print you can see the data you want on your device. Your cerbuino works, the xbee on the cerbuino works, and your code that talks to the xbee on the cerb works too. All good so far?
Assuming this is the current state, you open cerb-com1 to talk to the xbee. That then happens to open the channel from the sensor data. So cerb-com1 is only relevant to the xbee, not to anything to talk to the PC - so whatever you tried in the second scenario in that picture will only be changing the cerb–>xbee comms.
I guess there are two other parts of the puzzle you need to sort out. First, you need to move from using the coordinator on the sensor node to using the coordinator on the cerb. That should be a simple change, and it seems to me that you should have enough to work with on that (caveat: I am not an xbee guy
). The second change is to then move to using API mode not AT mode. I am not an xbee guy, someone else will have to weigh in to help more there ! Out of interest though, have you searched codeplex, I believe there’s a netmf project there that has xbee capability and IIRC it handles API mode.
Then the final part of “getting this working” is to turn the connection between the cerb and the PC from a debugging connection to a truly serial connection. To do that we either need to a) resolve the CDC/USB Client serial capability in the Cerb family firmware, or b) move to an additional module or connection that uses a UART and fronts up a serial port over USB. My personal suggestion is still to use a CP2102 module, but a “more formed” device could be the USB-serial module from GHI https://www.ghielectronics.com/catalog/product/287
Do you intend to turn this into a “solution” that needs to be simple for other people to use, as that might lead you to different pieces that are more “consumer” friendly rather than things that are tinker-er friendly like we’ve talked about so far.
Also I’d investigate the SIM900 module capabilities before you buy it, if you explain what you want to achieve there, people can suggest whether that will or will not be suitable.