RE: [Tinyos-help] help, strange automatic fired timer!!
campbell gao [EMAIL PROTECTED] escribió: hi all, [...] But how strange it is!! The sampling start up when i turn on the node's switch!! And sampling data is sent back!! Who could tell me that is why?? Probably there is some part of your code which is executing when it shouldn't. Use the toggle leds commands to check what is running and what isn't. Regards, - J. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Noise on TelosB PAR Sensor!
Hello, I am using TelosB motes with Hamamatsu's PAR and TSR light sensors. I am monitoring the readings of the PAR sensor and I have noticed the following, using constant light intensity: - For low levels of light intensity (ADC output being approx. 0.7V), sampling over time of the light sensors returns a constant light level, as expected. - For higher levels of light intensity, noise a noise which is between 2-3Hz and proportional to the light intensity appears. This noise has an amplitude of up to 0.04V, which is a lot, considering the light measures are in the range of 1V. Suspecting the noise was related to the AC-Current, I tried different configurations and different lights, but I am always getting the same noise, so it looks like it is a problem in the mote itself. And all nodes have it. Is this a known problem and if so, is there a solution for it other than trying to implement a digital filter on the sensor nodes? Or is this not normal and I am probably doing something wrong? Thanks a lot, - J. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Multiple instances of SerialForwarder
Hello all, I have been creating a couple of scripts on bash to help me deal with the connection and disconnection of motes to the computer automatically. I want to open N connections to N motes using N SerialForwarders. To do this, I have a while loop which reads the USB addresses from a lookup table and launches SerialForwarder like this: cd $TOSROOT/tools/java java net.tinyos.sf.SerialForwarder -no-gui -comm [EMAIL PROTECTED]:telosb -port $[$i+9000] $MOTE_ADDR is i.e. /dev/ttyUSB5 and $i increases on each loop, to have each Forwarder on a different port. This seems to work but after about 30 seconds the connections begin to die... What am I doing wrong? Thanks, - J. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Serial Forwarder Problem
Jose, To connect to multiple motes you would write something along the lines of: [...] Thanks a lot for that. I had been trying to use these phoenix sources a while ago but didn't get to make my program work. This means that when I start a java program that wants to talk to different motes through different SerialForwarders, it needs also needs to read from a table for each mote id in which USB port it is connected. What's more, if I want to send a message to mote 100, for example, using mote_if_of_mote100.send(100, message); and mote_if_of_mote100.send(TOS_BCAST_ADDRESS, message); will give the same result. But this would also mean that it is not possible to send a message to _all_ motes simultaneously, right? This would be a big problem... - J. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Serial Forwarder Problem
2006/8/24, Robert Szewczyk [EMAIL PROTECTED]: Sure -- I could see a solution where you use some method to synchronize all motes to a common time base (perhaps using any of the proposed radio time sync protocols) and then you use USB to transmit messages of the form: at time X do Y,where time X is sufficiently far in the future. Well, I was thinking more along the lines of using USB if only one mote were to be contacted and using radio if a message had to be sent to all motes simultaneously. Thanks for your help. - J. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Serial Forwarder Problem
2006/8/24, Robert Szewczyk [EMAIL PROTECTED]: But this would also mean that it is not possible to send a message to _all_ motes simultaneously, right? This would be a big problem... That's correct. Simultaneous transmission to all motes over usb would be difficult over a point to point link such as USB . USB host schedules transmissions to individual endpoints on a 1 ms granularity, and depending on the precise timing of requests you may observe as much as 2 ms between requests. It sounds like if you want motes to receive a message simultaneously, a radio broadcast channel may be appropriate. Mmmm... Perhaps a better solution would be to use both USB and radio... I have used SerialForwarder Multiplexer but I am not getting very good results and I am thinking that using multiple instances of SerialForwarder and mapping might be more work but in the end the computer-mote communication should be more reliable this way... - J. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
RE: [Tinyos-help] Boomerang and TinyOS 1.x
Well, the MoteIV RPM is indeed not installing properly. I am getting these errors: make[2]: Entering directory `/opt/tos/tinyos-1.x/tools/java/net/tinyos/sim/msg' mig java -target=pc -java-classname=net.tinyos.sim.msg.DebugMsgEvent ../../../../../../tos/platform/pc/GuiMsg.h DebugMsgEvent -o DebugMsgEvent.java make[2]: mig: Command not found make[2]: *** [DebugMsgEvent.java] Error 127 * I am getting the mig not found error several times, but if I type mig in the command line it works. make[1]: Entering directory `/opt/tos/tinyos-1.x/tools/java/net/tinyos/vm_asm' ... /opt/tos/tinyos-1.x/tools/java/net/tinyos/vm_asm make[1]: ncc: Command not found make[1]: ncc: Command not found make[1]: Entering directory `/opt/tos/tinyos-1.x/tools/java/net/tinyos/deluge' Makefile:21: /../tools/java/Makefile.include: No such file or directory make[1]: *** No rule to make target `/../tools/java/Makefile.include'. Stop. Besides, when compiling applications which used to give no warnings on tinyos-1.x, now I am getting such things: nesc1: warning: calls to ReceiveMsg.receive in AMStandard fan out, but there is no combine function specified for the return type nesc1: warning: calls to PowerManagement.adjustPower in AMStandard fan out, but there is no combine function specified for the return type nesc1: warning: calls to ReceiveCombined.receive in FramerAckM fan out, but there is no combine function specified for the return type - J. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
RE: [Tinyos-help] Weird results...
Hi all... I have come with an idea of the origin of the faulty behaviour of my experiment... To simplify I will illustrate it with two dimmers: they are connected to the wall sockets and to the motes, and the motes are connected per USB to a HUB which is also connected to a wall socket and to the computer. When I set one of the motes to a determined voltage, could be the a sort of circuits closes and that's why both lights turn themselves on? the circuit should be closed through the wall sockets and through the USB hub. If this is true, my only options to solve this problems would be: a) To connect each of the dimmer to wall sockets which I know are 100% isolated. b) connect the motes which are connected to the dimmers to separate USB hubs and hope that they are isolated from each other, or to avoid using USB altogether... Any comments or suggestions would be greatly appreciated... Thanks, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
RE: [Tinyos-help] Weird results...
Joe, yeah, my configuration is as follows: I have 10 motes, five of them are connected to the inverter/amplifier/dimmer group. This means I need three hubs, each of them with four usb outputs. For this experiment only these 5 motes are connected, and my hub configuration is as follows: All three hubs are connected to the 220V net. An USB cable connects the computer with the first hub. On this hub, three of the outputs can be used to connect motes, the fourth has a USB cable connecting it to the second hub, and on this one a USB cable connects it to the third hub, so all the outputs are connected to the computer. Since there aren't enough sockets on the wall, the hubs are all connected to one of those socket replicators, which in turn is connected to a bigger one which is connected to the wall. - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Weird results...
Yeah, I do that. I think it's an electrical problem: The motes are connected with USB cables to USB hubs, which are connected with each other, to the power and to the computer If I order one node to give the maximum output and there are 2 nodes connected, each gives 1/2 of the maximum output, if there are 3, each 1/3, etc... Would a voltage follower between the the mote and the inverter solve the problem? Is there a simpler solution? Of course having the motes isolated from each other and receiving radio commands would solve the problem, but I need to keep the USB connection, since at a later stage the motes should be sending measurements to the computer continuously... Thanks again... On Thu, 2006-07-06 at 09:32 -0700, Dongyan Chen wrote: When you program your motes, have you programmed them with different node ids like make tmote reinstall,NODE_ID? - Dongyan On 7/6/06, Jose L. Ponce [EMAIL PROTECTED] wrote: Hello all, My question is very simple: I have 5 motes with the same program installed. This program receives an instruction from the computer and executes it (i.e. dac output to 2 volts). I am sending the instruction using moteif.send(MOTEID, message), so theoretically just the mote MOTEID should receive the message. This is not the case, though, and all motes seem to receive the message and execute it. And what's more strange: if I have two motes and I send set dac to 0x (which should be the maximum, 3 volts) both motes receive the message and each of them has an output of 1.5 volts!! The nodes are connected to the computer through USB and communication is made using this means, not radio. The DAC outputs are connected to an inverter amplifier and this amplifier is connected to a DC-Controlled Dimmer. Could the problem be related to impedances??? Any thoughts on what could be causing this anomaly and how to solve it? Thanks, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Regarding Time Sync and Timestamping
Dear all, I have been working on a time sync protocol between the pc and the motes. I think I have solved most of the problems on the java side and I would like to improve things on the motes. My test for the time-sync consists of running the sync protocol every i.e. 60 seconds and sending messages to 2 motes every 2 seconds which say: at time X, change the DAC. I use a digital oscilloscope to monitor the outputs and see how good the response is (difference between both responses). As for now, I have noticed that for each resync the delay in the changes of the DAC outputs remains constant, but there are great differences between two resyncs: one might give a difference of 1ms and the next a difference of 20ms. I am trying to reduce this variability as much as possible As Janos suggested, I have looked for a way to do the timestamping with the SFD interrupt. Looking through CC2420RadioM, I have noticed async event result_t SFD.captured(uint16_t time). Looks like there is a timestamping going on already, and I have read somewhere that it is recorded on rxbufptr-time, so I've been trying to extract it on message reception (In ReceiveMsg.receive) like this: event TOS_MsgPtr ReceiveMsg.receive( TOS_MsgPtr msg ) { struct TOS_Msg* r_time; r_time = (struct TOS_Msg *)msg-data; t2 = (r_time-time)/0.032; } But it doesn't seem to be working. I get three or four fixed values every time a synchronisation is run (0 and 10013) come to mind... I have tried vu's timestamping as well but on a call to get timestamp t2 is always 0. Does anyone know a simple way to get a timestamping with the SFD interrupt handler? Or a suggestion as to to why a resynchronisation has such a big variability while the delays are so constant (which would suggest that the problem is not on the timers, but on the send/receive interfaces) and how to improve it? Any comments are appreciated. Thank you, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
RE: [Tinyos-help] Problems with Time Sync
Janos, thanks for your quick answer. I noticed, as you said, that a lot of my problems might be related to the PC/motes interaction. However, I fail to understand what you mean with tasks/interruptions. Are you suggesting I should create interruptions (async command or event) which would be called from ReceiveMsg.receive/Timer.fired in which to perform the operations I want to make sure they happen with no delay? Thanks, - Jose Try to avoid doing anything that is time critical in task context. E.g. timestamping a message in ReceiveMsg.receive is inadequate, because it's called from a task. Similarly, Timer.fired is also signaled from a task, which has a non-negligible jitter if you want to use it for timesync. Doing as much as possible from within the interrupt handlers would solve much of your issues. However, syncing with the PC is still kind of problematic, since the time difference between sending out a message from your java app and receiving it on the mote has a pretty bad variance... Janos ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Getting system time and clock ticks in tinyos
On Sun, 2006-04-23 at 09:46 -0400, Vinayak Naik wrote: You can use SimpleTime component to get system time. Alternatively, I think you can use LocalTimeMicroC too to get the mote time. I am working with Telos and SimpleTime doesn't seem to work, and LocalTimeMicroC seems like a valid alternative. - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Receiving different message types simultaneously in Java.
Hi, Thanks for your reply. On Fri, 2006-04-21 at 13:15 -0600, Michael Schippling wrote: I haven't use the interface in question, but it looks as if the message routing (via handlerID) is left as an exercise for the reader. I imagine that you need to build a messageListener factory someplace that instantiates the right class for each reception. There are some comments in MoteIF about using this i/f, and there may be more examples if you search the tools/java tree. I have been looking through it and it seems like you are right; with registerListener you can select which type of messages you are receiving. However, I would like to see it working on some code example. Could anyone point me out to some java code which uses this kind of message type filtering? Thank you all, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Receiving different message types simultaneously in Java.
Hi all, Once again, I have a quick question regarding Java and message management. When classes which require receiving messages from the motes are programmed, usually all those classes are based on MessageListener. In this way, we have the following method when we receive a message: synchronized public void messageReceived( int to, Message m ) The problem comes when I have two classes, and each receives different types of messages: both classes have a messageReceived method, but it fires when a message is received, indepently from the message type, so it could happen that one class gets the message which was sent for the other class, and thus when I want to extract information from the message it doesn't work... In the mote side this doesn't happen because when send and receive are wired they are told which message type they should expect... How can I solve this problem on the Java side? Thank you all, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Control of multiple motes per USB
Hi, On Thu, 2006-04-06 at 13:03 -0700, Cory Sharp wrote: It sounds like, minimum, you want to open a SerialForwarder per mote, so that multiple connections can be made per device. There's a number of ways to do that. You could take a look at tinyos-1.x/contrib/nestfe/java/net/tinyos/sfmultiplex/ which has a small amount of documentation here http://nest.cs.berkeley.edu/nestfe/index.php/Tier_2. Thanks for the links. This is exactly what I needed! I guess I didn't make myself all that clear before :) Regards, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Control of multiple motes per USB
Hi all, funnily enough, now it seems to work. I guess after playing with the USB connections and stuff may jam them up a bit after a while. I tried again after a fresh restart and everything works. So, like I commented yesterday, I wanted to develop some kind of SerialForwarder for multiple motes connected to the computer per USB. I have been giving it some thought and I can't seem to find a way of doing it. I guess it might work for listening to the motes, but not for sending to them for the computer. For example, if we have two appications, say, one which listens to the motes, which periodically send a status message to it, and another which allows us to turn the leds on and off from the command line in the computer. If the listening application has all ports open to listen to all motes, and the led control application wants to send a command to a mote, it can't open a connection itself to that mote because it'd break the already existing connection that the listening program has with that mote. The best solution that I have thought of consists on writing a USBCom class which would handle all connections (basically create Phoenix and MoteIF objects based on the motes connected to the computer -- at first manually, but it'd be pretty interesting if it could be done automatically afterwards, a bit based on the idea David Moss commented some days ago), and integrate all independent applications into one program, a kind of shell which would allow the user to control all of them through commands, eg. listen for status messages, turn the red led on mote 5 on, etc... What do you think of this? Is it too complicated? Does anyone have a simpler/better suggestion to work on this? Any positive and negative comments will be greatly appreciated :) Thank you, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Control of multiple motes per USB
Hi, On Tue, 2006-04-04 at 11:46 -0700, Cory Sharp wrote: Take a look at the TinyOS Tutorial Lesson 6 if you haven't already. http://www.tinyos.net/tinyos-1.x/doc/tutorial/lesson6.html I recommend you study the TinyOS Java classes MoteIF, BuildSource, and PhoenixSource. You basically want to do something like this source = BuildSource.makePhoenix( motecomstr, PrintStreamMessenger.err ); mote = new MoteIF( source, groupid ); and do that for each connection you want to open. First of all, thanks for pointing me out to those classes, they clarified my problem a lot So what you are saying is, I can create PhoenixSources and use them to create a new MoteIF object which I should be able to use as usual to send/receive packets, so, for example, if I want to open three USB connections I can do that creating 3 PhoenixSources and 3 MoteIFs, and I wouldn't need to use SerialForwarder. My initial idea was to have a program which would create the PhoenixSource objects and keep them open, a la SerialForwarder, and have other programs create MoteIF objects to send and receive messages as necessary. I couldn't find a way to make this work, though; usually, MoteIF objects always connect to the serial forwarder using the default MOTECOM setting, and so they are always created with MoteIF((Messenger)null), and I can't create it with MoteIF(source5) if source5 is a variable from another program which is already running independently... Anyway, to simplify things a bit, I tried to make it all in the same program and use just one connection to simplify things, to see how it'd work without using SerialForwarder. To do this, I made a little program which should send a message to a Mote and get an answer from it. To establish the connection, I have tried with: try { source = BuildSource.makePhoenix( serial@/dev/ttyUSB3:telos, PrintStreamMessenger.err ); m = new MoteIF(source); m.registerListener(new DimmerControlMSG(), this); } But it fails to work. It apparently gets stalled on m = new MoteIF(source); the message I get on the console is: getenv JNI library not found. Env.getenv will not work (please consult installation directions in tinyos-1.x/tools/java/net/tinyos/util/Env.INSTALL) Experimental: JNI_OnLoad called. Devel Library = Native lib Version = RXTX-2.1-7pre20 Java lib Version = RXTX-2.1-7pre20 RXTX Warning: Removing stale lock file. /var/lock/LCK..ttyUSB2 I have no idea why this could be happening since I think I am doing it the proper way, and I don't think it's related to JNI. Any suggestions would be greatly appreciated. Thank you, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Control of multiple motes per USB
On Thu, 2006-03-30 at 10:21 -0700, Michael Schippling wrote: You can skip the SerialForwarder part and connect local programs directly to the USB ports by using a MOTECOM envvar like [EMAIL PROTECTED]:mica2 for each specific COM port. The Listen tool and anything that uses BuildPacketSource does this. I see... Well, what I want is to have some kind of bridge so that a program on the PC can listen simultaneously to all USB-connected motes and send and receive messages from them and to them, kind of like an USB-equivalent to TOSBase... I guess this is not all that uncommon... I guess it should have been used already, for example when you are trying a protocol you've programmed and you want the motes to send information through the USB to the PC when something happens, to be able to conduct performance experiments and such... Has anyone done something of this kind? I would appreciate some tips or examples... Thanks, - Jose. Jose L. Ponce wrote: Hello all, Usually, to be able to communicate with a mote which is connected to the pc, one opens serialforwarder and a bridge between the mote and the pc is built, so that a java program or something can send and receive messages from the mote. For me, until now, this also means that one can communicate with only one mote connected to the pc. In my experiment, I have several motes connected to my pc per USB, and I would like to be able to communicate with all of them per USB, not using the radio, to establish some kind of time sync so to build later a sampling system controlled by the computer. Any ideas of how I could do this? I find opening one SerialForwarder per mote is not the most efficient solution... Thanks in advance, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Control of multiple motes per USB
Hello all, Usually, to be able to communicate with a mote which is connected to the pc, one opens serialforwarder and a bridge between the mote and the pc is built, so that a java program or something can send and receive messages from the mote. For me, until now, this also means that one can communicate with only one mote connected to the pc. In my experiment, I have several motes connected to my pc per USB, and I would like to be able to communicate with all of them per USB, not using the radio, to establish some kind of time sync so to build later a sampling system controlled by the computer. Any ideas of how I could do this? I find opening one SerialForwarder per mote is not the most efficient solution... Thanks in advance, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Doubts about sending from the PC to different motes
On Fri, 2006-03-24 at 13:38 -0700, Michael Schippling wrote: To use 'standard' TOS messaging, basically the GenericComm component, all your messages need to be wrapped in a TOS_Msg struct. If you are using Java on the host/PC side, you need to construct a buffer that looks like a TOS_Msg and send it. I see... So what you are saying is that I should have an addr field on my message structure to be able to send this message to a particular mote? Like I said I create a MoteIF object, an object with the structure of my message and when I want to send it I use: MoteIF.send(destination mote id, message); Instead of what I have usually seen in other examples: MoteIF.send(MoteIF.TOS_BCAST_ADDR, message); And it works. What I have understood from your reply is that I should have an address field in my message struct and keep using MoteIF.TOS_BCAST_ADDR when I call MoteIF.send... Is that right? - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Doubts about sending from the PC to different motes
Hi all, I guess this question is pretty simple, but I can't seem to figure out how to do this: I have done this little application to control a mote's DAC from a laptop through the USB cable. Now I would like to take it an step further and be able to control several motes. I have been looking around for information on this topic and I guess I should have TOSBase installed on a mote, which should be connected to the computer, and send the messages from the computer to this TOSBase mote, which would then forward the messages to the specific mote and take their answers and forward them back to the computer. The problem is that I don't know very well how to do this. I do program my motes with install.X and give them different id's, and I guess I should modify the java program on the laptop so that a moteid should also be specified. What I don't know is if I should modify TOSBase in any way so it can analyse the message structures I am using, in which I would add a destination field, so that it knows where to forward the message, or if I can do this without changing TOSBase, modifying the java application to tell TOSBase where to forward the message... Any information which could help me with this is greatly appreciated. Thank you, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Strange results when sending uint16_t values.
Hi all, I want to control the DAC of my telosb mote using commands from the computer through the USB port. For that, I've programmed an application which receives a message with two fields: uint8_t for the command and uint16_t for the value we want to set the DAC to. There are two commands: set (1), with a value, to set the DAC, and show, without a value, to see to which value the DAC is set to (when issuing a set command, the mote returns the DAC value as well). On the computer side, the commands are issued using a small java application: java Dimmer set X java Dimmer show The problem is that the value field (uint16_t) is not recognised: I will issue java Dimmer set 10 ten times and each time I will get a different DAC output and a different return value from the mote. I have tried to modify my message type and have the value field as a uint8_t. In this way, issuing a set command from 0 to 256 will give me right values. Above that, it doesn't seem to work anymore. Can anyone enlighten me a little on what I am doing wrong? It'd be much appreciated. Below I include the relevant code. Thanks, - Jose. // DimmerControlM.nc (on the mote) // DimmerControlMSG has two fields: todo (uint8_t) and value (uint16_t) task void sendMsg(){ struct DimmerControlMSG* sen; sen = (struct DimmerControlMSG *)outw.data; sen-value = value; call SendMsg.send( TOS_UART_ADDR, sizeof(struct DimmerControlMSG), outw); } event TOS_MsgPtr ReceiveMsg.receive( TOS_MsgPtr inw ){ struct DimmerControlMSG* rec; rec = (struct DimmerControlMSG *)inw-data; if( rec-todo 0x1 ) { value=rec-value; if(call DAC.output(value) == SUCCESS) call Leds.redToggle(); } post sendMsg(); return inw; } ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Fwd: Re: [Tinyos-help] ReverseUART won't work in telosb]
---BeginMessage--- I run it with serial@/dev/ttyUSB0:telosb, which reports: Listening for client connections on port 9001 serial@/dev/ttyUSB0:19200: resynchronising - Jose. On Sat, 2006-03-18 at 10:26 -0800, Cory Sharp wrote: Is your serial forwarder reporting the correct baud rate? - Cory On 3/18/06, Jose L. Ponce [EMAIL PROTECTED] wrote: Hi Cory, Thanks for your reply. I am using TinyOS 1.15, and I have also tried with MoteIV's Boomerang... What buggers me is that everything will compile and upload smoothly to the mote, and then I get this write failed error in SerialForwarder. I am using ReverseUART as a model for the way my application receives/sends messages and it's obviously not working either. I'm quite puzzled by this... - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ---End Message--- ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] ReverseUART won't work in telosb
Hi all, I am working with both Telos Rev. A and Telos Rev. B motes. I have been trying the ReverseUART application and I have noticed that, while it works for Telos A, it won't work for Telos B. In Telos A everything's fine, but in Telos B, I run java testReverseUART something and I get: Send something And in SerialForwarder I get a write failed message. Anyone knows why this happens and how to solve it? Thanks, - Jose. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help