Ok, after some investigation I found out that when I am trying to ping or
inject an image to the mote, the following error occurs in the read
function of tos-deluge file:
def read(imgNum, offset, length):
r = []
sreqpkt = FMReqPacket((FM_CMD_READ, imgNum, offset, length, []))
hamtemp=0
while True:
if sreqpkt.length > SERIAL_DATA_LENGTH:
sreqpkt.length = SERIAL_DATA_LENGTH
if am.write(sreqpkt, FM_AMID):
packet = am.read()
reply = SerialReplyPacket(packet.data)
if reply.error == ERROR_SUCCESS:
r.extend(reply.data)
else:
r = None
break
else:
r = None
break
sreqpkt.offset += sreqpkt.length
if sreqpkt.offset >= (offset + length):
break
sreqpkt.length = (offset + length) - sreqpkt.offset
return r
The problem is that in that While loop, first time that packet=am.read() is
executed packet is valid, for the second time, still packet is received and
valid, but for the third time, packet=am.read() returns None for packet,
whcih later messes the reply=SerialReplyPacket(packet.data) because there
is no data attribute. I have no idea why packet is not being received from
am, I tried to increase the timeout of read function for am to 5
(packet=am.read(timeout=5) but still nothing was received,
I appreciate if anyone can help, I really need to get Deluge on the IRIS
mote to save hours later for programming the motes,
Thanks,
Hamid Rafiei Karkvandi
On Thu, May 24, 2012 at 12:55 PM, Hamid Rafiei Karkvandi <
[email protected]> wrote:
> Hi,
>
> I would like to add some new information to my post, it seems the error:
>
> - AttributeError: 'NoneType' object has no attribute 'data'
>
> is generated by Python engine. I am not that skilled in Python yet, but
> after doing some search, I found out that the problem should be mainly
> because getIdent() function in tos-deluge is not returning a valid value
> and it should be None which is not accepted by Python,
>
> I also tried to install the Blink in apps/tests/deluge/Blink by:
> $ ./burn mib520,com3 serial@com4:57600 iris
>
> it perfectly works as intended but when I try to ping the node:
>
> $ tos-deluge serial@com4:57600 -p 0
>
> Flushing the serial port..
> Checking if node is a Deluge T2 base station ...
> Pinging node ...
> --------------------------------------------------
> Currently Executing:
> Prog Name: BlinkAppC
> UID: 0xA8160D04
> Compiled On: Thu May 24 12:16:54 2012
> Node ID: 1
>
>
> Traceback (most recent call last):
> File "/usr/local/bin/tos-deluge", line 437, in <module>
> ping(imgNum)
> File "/usr/local/bin/tos-deluge", line 353, in ping
>
> i = getIdent(imgNum)
> File "/usr/local/bin/tos-deluge", line 276, in getIdent
> r = read(imgNum, DELUGE_IDENT_OFFSET, DELUGE_IDENT_SIZE)
> File "/usr/local/bin/tos-deluge", line 180, in read
> reply = SerialReplyPacket(packet.data)
> AttributeError: 'NoneType' object has no attribute 'data'
>
>
> I appreciate your help beforehand,
>
>
> Regards,
>
>
> Hamid Rafiei Karkvandi
>
>
>
>
>
> On Thu, May 24, 2012 at 11:06 AM, Hamid Rafiei Karkvandi <
> [email protected]> wrote:
>
>> Hello Everyone,
>>
>> I have got a problem with Deluge protocol. After a tough day I
>> successfully installed and configured Deluge using these scripts:
>> ./Bootstrap
>> ./configure
>>
>> and then make; make install for tools/tinyos/misc as the Tutorial
>> suggested and everything successfully installed,
>>
>> I am working on IRIS platform. I installed the Basestation program on
>> IRIS using "make iris install,0 mib520,com3", successfully installed.
>> but when I try to inject an image on this mote I get the following lines
>> and errors:
>>
>> $ tos-deluge serial@com4:57600 -i 1
>> $TOSROOT/apps/Blink/build/iris/tos_image.xm
>> l
>> Flushing the serial port..
>> Checking if node is a Deluge T2 base station ...
>> Pinging node ...
>> Traceback (most recent call last):
>> File "/usr/local/bin/tos-deluge", line 441, in <module>
>> inject(imgNum, sys.argv[4])
>> File "/usr/local/bin/tos-deluge", line 316, in inject
>> i = getIdent(imgNum)
>> File "/usr/local/bin/tos-deluge", line 276, in getIdent
>> r = read(imgNum, DELUGE_IDENT_OFFSET, DELUGE_IDENT_SIZE)
>> File "/usr/local/bin/tos-deluge", line 180, in read
>> reply = SerialReplyPacket(packet.data)
>> AttributeError: 'NoneType' object has no attribute 'data'
>>
>> I cannot trace what the problem is, I have seen couple of other posts
>> similar to mine but no satisfactory solution was found. I have updated my
>> tinyOS to R5949 at the time.
>> I appreciate if anyone can guide me through this,
>>
>>
>>
>>
>>
>>
>>
>> Regards,
>>
>>
>> Hamid Rafiei Karkvandi
>>
>>
>>
>>
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help