<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Receive USRP data on lopy lora]]></title><description><![CDATA[<p dir="auto">i tried to receive data from USRP, my code to receive data is<br />
rx_data = s.recv(64)<br />
if(rx_data):<br />
print(&quot;Received data: &quot;+str(rx_data))</p>
<p dir="auto">received data is not in properly decoded<br />
it displays some things like this:</p>
<p dir="auto">Rx_cnt:12<br />
(rx_timestamp=2217324419, rssi=-78, snr=1.0, sfrx=8, sftx=0, tx_trials=0)<br />
Received data: b'\xbd\xca'<br />
Rx_cnt:13<br />
(rx_timestamp=2218930349, rssi=-79, snr=2.0, sfrx=8, sftx=0, tx_trials=0)<br />
Received data: b'\xc5+*\xfe'<br />
Rx_cnt:14<br />
(rx_timestamp=2219519010, rssi=-75, snr=1.0, sfrx=8, sftx=0, tx_trials=0)<br />
Received data: b'\xe7\xdfl\xfb'<br />
Rx_cnt:15<br />
(rx_timestamp=2220686254, rssi=-84, snr=-0.0, sfrx=8, sftx=0, tx_trials=0)<br />
Received data: b'\xad\xee'<br />
Rx_cnt:16<br />
(rx_timestamp=2221272054, rssi=-77, snr=2.0, sfrx=8, sftx=0, tx_trials=0)<br />
Received data: b'\x95\xe7\xb8\xfa\xf0c\xee'<br />
Rx_cnt:17<br />
(rx_timestamp=2221760271, rssi=-93, snr=-3.0, sfrx=8, sftx=0, tx_trials=0)<br />
how to decode to get hex bytes or string text output</p>
]]></description><link>https://forum.pycom.io/topic/2938/receive-usrp-data-on-lopy-lora</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Mar 2026 20:59:46 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/2938.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 30 Mar 2018 04:08:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Receive USRP data on lopy lora on Fri, 30 Mar 2018 04:08:24 GMT]]></title><description><![CDATA[<p dir="auto">i tried to receive data from USRP, my code to receive data is<br />
rx_data = s.recv(64)<br />
if(rx_data):<br />
print(&quot;Received data: &quot;+str(rx_data))</p>
<p dir="auto">received data is not in properly decoded<br />
it displays some things like this:</p>
<p dir="auto">Rx_cnt:12<br />
(rx_timestamp=2217324419, rssi=-78, snr=1.0, sfrx=8, sftx=0, tx_trials=0)<br />
Received data: b'\xbd\xca'<br />
Rx_cnt:13<br />
(rx_timestamp=2218930349, rssi=-79, snr=2.0, sfrx=8, sftx=0, tx_trials=0)<br />
Received data: b'\xc5+*\xfe'<br />
Rx_cnt:14<br />
(rx_timestamp=2219519010, rssi=-75, snr=1.0, sfrx=8, sftx=0, tx_trials=0)<br />
Received data: b'\xe7\xdfl\xfb'<br />
Rx_cnt:15<br />
(rx_timestamp=2220686254, rssi=-84, snr=-0.0, sfrx=8, sftx=0, tx_trials=0)<br />
Received data: b'\xad\xee'<br />
Rx_cnt:16<br />
(rx_timestamp=2221272054, rssi=-77, snr=2.0, sfrx=8, sftx=0, tx_trials=0)<br />
Received data: b'\x95\xe7\xb8\xfa\xf0c\xee'<br />
Rx_cnt:17<br />
(rx_timestamp=2221760271, rssi=-93, snr=-3.0, sfrx=8, sftx=0, tx_trials=0)<br />
how to decode to get hex bytes or string text output</p>
]]></description><link>https://forum.pycom.io/post/17850</link><guid isPermaLink="true">https://forum.pycom.io/post/17850</guid><dc:creator><![CDATA[nilam]]></dc:creator><pubDate>Fri, 30 Mar 2018 04:08:24 GMT</pubDate></item><item><title><![CDATA[Reply to Receive USRP data on lopy lora on Fri, 30 Mar 2018 06:41:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/2555">@nilam</a> You'll get hex ascii representation with ubinascii.hexlify(), like:</p>
<pre><code>import ubinascii
print(&quot;Received data: &quot;, ubinascii.hexlify(rx_data))
</code></pre>
<p dir="auto">I the samples you gave there are almost no printable characters, so displaying it as ASCII is not that useful.</p>
]]></description><link>https://forum.pycom.io/post/17853</link><guid isPermaLink="true">https://forum.pycom.io/post/17853</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Fri, 30 Mar 2018 06:41:59 GMT</pubDate></item><item><title><![CDATA[Reply to Receive USRP data on lopy lora on Fri, 30 Mar 2018 06:57:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/98">@robert-hh</a> what is the format of received data? like b'\xc5+*\xfe'.<br />
is it utf-8? base64?<br />
Sorry, i am asking very basic .</p>
]]></description><link>https://forum.pycom.io/post/17856</link><guid isPermaLink="true">https://forum.pycom.io/post/17856</guid><dc:creator><![CDATA[nilam]]></dc:creator><pubDate>Fri, 30 Mar 2018 06:57:27 GMT</pubDate></item><item><title><![CDATA[Reply to Receive USRP data on lopy lora on Fri, 30 Mar 2018 07:05:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/2555">@nilam</a> Python displays it as a mix of hex and ascii. so at<br />
b'\xc5+*\xfe' you have 4 bytes, two of them, + and * are printable. I made a little hexdump function, which translates that to the usual way. It expects an bytes object as input</p>
<pre><code>#
# Hexdump Function
#
FILTER=''.join([(len(repr(chr(x)))==3) and chr(x) or '.' for x in range(256)])

def hexdump(src, length=16):
    N=0; result=''
    while src:  # loop through string
       s,src = src[:length],src[length:]
       hexa = ' '.join([&quot;%02X&quot;%x for x in s])
       s = ''.join([FILTER[s[_&rsqb;&rsqb; for _ in range(len(s))])
       result += &quot;%04X   %-*s   %s\n&quot; % (N, length*3, hexa, s)
       N += length
    return result
</code></pre>
<p dir="auto">so hexdump(b'\xc5+*\xfe') returns:</p>
<pre><code>0000   C5 2B 2A FE                                        .+*.\n
</code></pre>
<p dir="auto">As a side note: if you enclose you code with lines, that consist of three backticks (```), it gets printed accodingly</p>
]]></description><link>https://forum.pycom.io/post/17857</link><guid isPermaLink="true">https://forum.pycom.io/post/17857</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Fri, 30 Mar 2018 07:05:02 GMT</pubDate></item><item><title><![CDATA[Reply to Receive USRP data on lopy lora on Fri, 30 Mar 2018 10:02:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/98">@robert-hh</a> thank you for quick response.</p>
]]></description><link>https://forum.pycom.io/post/17865</link><guid isPermaLink="true">https://forum.pycom.io/post/17865</guid><dc:creator><![CDATA[nilam]]></dc:creator><pubDate>Fri, 30 Mar 2018 10:02:31 GMT</pubDate></item><item><title><![CDATA[Reply to Receive USRP data on lopy lora on Fri, 30 Mar 2018 12:00:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.pycom.io/uid/2555">@nilam</a> Just to be pedantic, I simplified hexdump a bit. This is old code, collected when I started with Python.</p>
<pre><code>FILTER=''.join([(len(repr(chr(x)))==3) and chr(x) or '.' for x in range(256)])

def hexdump(src, length=16):
    N=0; result=''
    while src:  # loop through string
       s,src = src[:length],src[length:]
       hexa = ' '.join([&quot;%02X&quot;%x for x in s])
       s = ''.join([FILTER[_] for _ in s])
       result += &quot;%04X   %-*s   %s\n&quot; % (N, length*3, hexa, s)
       N += length
    return result
</code></pre>
<p dir="auto">I have my doubts whether I did all of that myself at that time, especially the FILTER= .. expression.</p>
]]></description><link>https://forum.pycom.io/post/17866</link><guid isPermaLink="true">https://forum.pycom.io/post/17866</guid><dc:creator><![CDATA[robert-hh]]></dc:creator><pubDate>Fri, 30 Mar 2018 12:00:43 GMT</pubDate></item></channel></rss>