Server side ws message decoding error

#1

Hi!

I'm using Autobahn ws in an app that does real time signal acquisition
and processing. The client side is an Android device that gathers the
signal at a sampling rate of 1000Hz and transmits 100 samples every
0.1s. On the server side, it is supposed to receive the signal and
retrieve a filtered version back to the Android.

Everything works fine, except once in a while, when the server
receives a message which it cannot decode. All the sent messages have
the same valid structure, but every once in a while the server finds
an error which I can't ignore since it would mean data loss.

I don't know if it is related with the message size, or rate. I'd like
to understand what happens if I try to send a message through an
Autobahn ws whilst it is sending a previous one. Could this be the
case?

I'll just leave one server side log below, where it's printed every
received message and the error, if there is one.

Thank you in advance,

Michel Cânovas

Note: the first two results are the last ones to be as they should.
  Separator: -----.------
  The correct message has the following structure:
CMDqueue.put({'Frames': [...]})

Log result:

CMDqueue.put({'Frames':[-128, 125, 122, 119, 118, 119, 121, 125, -128,
-126, -123, -121, -120, -119, -120, -121, -123, -125, -127,

-128, 126, 124, 121, 121, 122, 124, 126, 127, -128, -125, -124, -124,
-122, -120, -119, -120, -122, -123, -125, -128, -128, -127,

-127, 125, 122, 122, 123, 122, 121, 121, 123, 126, -127, -125, -124,
-124, -126, -127, -128, 127, 126, 124, 121, 120, 121, 122, 1

22, 121, 122, 125, -127, -124, -123, -125, -125, -126, -125, -126,
127, 125, 123, 123, 122, 120, 118, 117, 119, 121, 124, 127, -12

7, -128, 127, 127, -128, -127, -127, -128, 126, 123]})

-----.------

CMDqueue.put({'Frames':[121, 122, 122, 122, 122, 123, 124, 125, 125,
126, 127, -128, -127, -126, -126, -126, -127, -127, -128, 126

, 126, 125, 122, 121, 121, 121, 120, 119, 119, 123, 126, 127, -126,
-126, -128, 127, 127, 127, -128, -127, -127, 127, 125, 125, 12

5, 126, 127, -127, -125, -123, -121, -119, -117, -115, -113, -110,
-108, -107, -108, -112, -115, -115, -115, -116, -117, -118, -11

9, -120, -121, -122, -123, -123, -123, -123, -123, -124, -125, -127,
126, 124, 121, 116, 111, 105, 102, 100, 100, 102, 105, 108, 1

10, 113, 115, 117, 117, 116, 117, 119, 121, 120]})

-----.------

M​:left_right_arrow: O\:slight_smile: QK​:heart:◄NM​:left_right_arrow:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow: O\:slight_smile: QM​:heart:◄NM​:left_right_arrow: O\:slight_smile: QN​:heart:◄NM​:left_right_arrow::heart:O\:slight_smile: QH​:heart:◄NM​:left_right_arrow::spades:O
\▲♥UP☼ QH♥◄RN→

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

M▲ O\:slight_smile: RE​:heart:◄NM​:left_right_arrow::slight_smile:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow:O\▲:heart:TP☼ QI​:heart:◄RN←:left_right_arrow:CM​:left_right_arrow::clubs:O\▲:heart:PP☼ QH​:heart:◄RN←:left_right_arrow:CM​:left_right_arrow:O
\:slight_smile: QD​:heart:◄RN↑

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

:slight_smile:◄▼▲► :slight_smile:◄▼▲► :slight_smile::slight_smile:◄▼:slight_smile:▼:diamonds:▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄:heart::slight_smile:

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

∟↔◄↓↔♀↕←↔♀◄▼ ∟♥←♀↕←↔♀◄▼♣ ∟♥↑♀

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

§ ◄:spades:▲R#\:diamonds:↑ ]BO>:heart:TD]:slight_smile:EXT∟UYE​:heart:TGU​:slight_smile:EXT∟TYE​:heart:TGQ​:slight_smile:EXT∟PYE​:heart:TGP​:slight_smile:EXT∟PY

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

:slight_smile:▲§:slight_smile:►:left_right_arrow::arrow_up_down:←∟♀◄▼↓♀ ∟:slight_smile:←♀

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

∟♀◄:heart::left_right_arrow:↨:left_right_arrow::arrow_up_down::left_right_arrow:◄▲♀◄

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

→♀◄▼:left_right_arrow::arrow_up_down: ▲♀

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

  File "<string>", line 1

    →♀◄▼:left_right_arrow::arrow_up_down:

    ^

SyntaxError: invalid syntax

-----.------

◄♠♂R#\◄↑ ]WO>▼B@I♫AGQ

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

:heart:▼♀◄ ▲§:left_right_arrow:◄:left_right_arrow::arrow_up_down::left_right_arrow:♀◄:heart::spades: :heart:→♀◄ ▲¶:left_right_arrow:◄:left_right_arrow::arrow_up_down::diamonds::left_right_arrow:♀◄:heart::spades: ∟ ▲▬:left_right_arrow:◄:slight_smile:◄:heart::slight_smile: ∟ ▲◄:left_right_arrow:◄:slight_smile:◄:heart::slight_smile:
▲:arrow_up_down::left_right_arrow:◄:slight_smile:◄:heart::diamonds: ∟ ▲↨:left_right_arrow:◄:slight_smile:

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

◄:heart:↓:left_right_arrow::arrow_up_down::diamonds:▲:diamonds:▲§:left_right_arrow::heart::diamonds:↓♀ :heart: ◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :diamonds: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :heart:♀ ◄▼:diamonds::left_right_arrow: ▲§:slight_smile: :heart:

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

:spades:→:left_right_arrow:◄:spades::left_right_arrow::diamonds::left_right_arrow:↨:left_right_arrow: :slight_smile:←♀ :diamonds::spades:▲:left_right_arrow:◄:spades::left_right_arrow::slight_smile::left_right_arrow:↨:left_right_arrow: :diamonds:←♀ ☼ ◄ :spades::left_right_arrow:◄:spades::left_right_arrow::left_right_arrow:↨:left_right_arrow: ←♀ :slight_smile::slight_smile: ◄ ▼:left_right_arrow:◄

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

∟▲¶:slight_smile:◄:left_right_arrow::arrow_up_down:←:left_right_arrow:♀ ▲§:slight_smile:◄:left_right_arrow::arrow_up_down:→:left_right_arrow:♀◄▼:diamonds: ∟:heart:↑♀

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

◄▼▲ ▲▬:left_right_arrow::heart::clubs:→♀ ◄:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:

→♀∟:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:→♀∟:heart::diamonds:▲:left_right_arrow::arrow_up_down:←:left_right_arrow::heart::slight_smile:→♀∟:heart::diamonds:∟:left_right_arrow::arrow_up_down:

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

7aqw ``t%yle&~ti7}rp;lmt%tle:}rs;lmt%yle:}rv;lmt%~le:}rt;lmt&ule:}
q};lmt&ule:}ru;lmt%~le:}rp;lmt%tle&~vi7

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

  File "<string>", line 1

    7aqw ``t%yle&~ti7}rp;lmt%tle:}rs;lmt%yle:}rv;lmt%~le:}rt;lmt&ule:}
q};lmt&ule:}ru;lmt%~le:}rp;lmt%tle&~vi7

       ^

SyntaxError: invalid syntax

-----.------

%~le&~ri7}rv;lqw"``t%yle&~vi7}rs;lqw#``t%~le&}yi7}q|;lqt ``t&yle&}ui7}
qs;lqt!``t&{le&}yi7}rt;lqw&``t%~le&~ri7}rw;lqw

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

  File "<string>", line 1

    %~le&~ri7}rv;lqw"``t%yle&~vi7}rs;lqw#``t%~le&}yi7}q|;lqt ``t&yle&}
ui7}qs;lqt!``t&{le&}yi7}rt;lqw&``t%~le&~ri7}rw;lqw

    ^

SyntaxError: invalid syntax

-----.------

◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:spades:▲§:left_right_arrow::heart:

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

:heart::slight_smile::left_right_arrow:♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:◄:clubs:▼♀◄:heart::diamonds: :heart::slight_smile:¶♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:

▼♀◄ :heart: :heart::slight_smile:▼♀:arrow_up_down::slight_smile:▲▬▲:bangbang::slight_smile::diamonds: ▼:slight_smile:▲¶▲

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

  :spades::slight_smile:◄:heart::spades:§:left_right_arrow::arrow_up_down::spades:∟:spades:▲↨∟ :diamonds:←▼:diamonds:▲↨∟:heart::spades:

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

♀◄:heart::arrow_up_down::left_right_arrow::arrow_up_down:▲§◄ ♂↓ :heart:♀♀◄:heart::diamonds:↓:left_right_arrow::arrow_up_down:▲§◄:heart::heart:↓ ♀◄:heart:§:left_right_arrow::arrow_up_down::diamonds::arrow_up_down:▲§◄:heart::clubs:↓ ∟:heart:↨:left_right_arrow::arrow_up_down:↑◄:heart:↓ ∟:heart:§:left_right_arrow::arrow_up_down:↑◄:heart::diamonds:

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

§♀◄ :left_right_arrow:↑:left_right_arrow:◄:left_right_arrow:◄ :left_right_arrow:♀◄ ←♀◄ :left_right_arrow:↨:left_right_arrow:◄:left_right_arrow::arrow_up_down::slight_smile::left_right_arrow:♀◄:heart::diamonds: ∟ ▲

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

▼▲↨▲▬:slight_smile:◄ :heart: ▼▲§▲▬:slight_smile:◄ :heart: ▼▲▬▲▬:slight_smile:◄ :slight_smile: :heart::diamonds:→♀:arrow_up_down:

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

-----.------

        ▲:bangbang::slight_smile:↑:slight_smile:◄▼☼ ∟

        ↔↨☺↑↔◄↓¶♀◄▼ ∟ §♀

Traceback (most recent call last):

  File "pywio.py", line 10, in evaluate

    res=eval(req)

TypeError: expected string without null bytes

0 Likes

#2

Hello again!

I know there is a lot to do regarding this platform, and a lot of requests to handle, but I would like to have some feedback concerning my post. Mainly know if I have been clear exposing the problem, or/and, if there is actually anyone looking at this, if the problem can be solved.

Thank you very much for the attention,

Best regards

Michel Cânovas

No dia 5 de Abril de 2012 12:56, Michel Cânovas michelm...@gmail.com escreveu:

···

Hi!

I’m using Autobahn ws in an app that does real time signal acquisition

and processing. The client side is an Android device that gathers the

signal at a sampling rate of 1000Hz and transmits 100 samples every

0.1s. On the server side, it is supposed to receive the signal and

retrieve a filtered version back to the Android.

Everything works fine, except once in a while, when the server

receives a message which it cannot decode. All the sent messages have

the same valid structure, but every once in a while the server finds

an error which I can’t ignore since it would mean data loss.

I don’t know if it is related with the message size, or rate. I’d like

to understand what happens if I try to send a message through an

Autobahn ws whilst it is sending a previous one. Could this be the

case?

I’ll just leave one server side log below, where it’s printed every

received message and the error, if there is one.

Thank you in advance,

Michel Cânovas

Note: the first two results are the last ones to be as they should.

Separator: -----.------

The correct message has the following structure:

CMDqueue.put({‘Frames’: […]})

Log result:

CMDqueue.put({‘Frames’:[-128, 125, 122, 119, 118, 119, 121, 125, -128,

-126, -123, -121, -120, -119, -120, -121, -123, -125, -127,

-128, 126, 124, 121, 121, 122, 124, 126, 127, -128, -125, -124, -124,

-122, -120, -119, -120, -122, -123, -125, -128, -128, -127,

-127, 125, 122, 122, 123, 122, 121, 121, 123, 126, -127, -125, -124,

-124, -126, -127, -128, 127, 126, 124, 121, 120, 121, 122, 1

22, 121, 122, 125, -127, -124, -123, -125, -125, -126, -125, -126,

127, 125, 123, 123, 122, 120, 118, 117, 119, 121, 124, 127, -12

7, -128, 127, 127, -128, -127, -127, -128, 126, 123]})

-----.------

CMDqueue.put({‘Frames’:[121, 122, 122, 122, 122, 123, 124, 125, 125,

126, 127, -128, -127, -126, -126, -126, -127, -127, -128, 126

, 126, 125, 122, 121, 121, 121, 120, 119, 119, 123, 126, 127, -126,

-126, -128, 127, 127, 127, -128, -127, -127, 127, 125, 125, 12

5, 126, 127, -127, -125, -123, -121, -119, -117, -115, -113, -110,

-108, -107, -108, -112, -115, -115, -115, -116, -117, -118, -11

9, -120, -121, -122, -123, -123, -123, -123, -123, -124, -125, -127,

126, 124, 121, 116, 111, 105, 102, 100, 100, 102, 105, 108, 1

10, 113, 115, 117, 117, 116, 117, 119, 121, 120]})

-----.------

M​:left_right_arrow: O\:slight_smile: QK​:heart:◄NM​:left_right_arrow:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow: O\:slight_smile: QM​:heart:◄NM​:left_right_arrow: O\:slight_smile: QN​:heart:◄NM​:left_right_arrow::heart:O\:slight_smile: QH​:heart:◄NM​:left_right_arrow::spades:O

\▲♥UP☼ QH♥◄RN→

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

M▲ O\:slight_smile: RE​:heart:◄NM​:left_right_arrow::slight_smile:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow:O\▲:heart:TP☼ QI​:heart:◄RN←:left_right_arrow:CM​:left_right_arrow::clubs:O\▲:heart:PP☼ QH​:heart:◄RN←:left_right_arrow:CM​:left_right_arrow:O

\:slight_smile: QD​:heart:◄RN↑

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:slight_smile:◄▼▲► :slight_smile:◄▼▲► :slight_smile::slight_smile:◄▼:slight_smile:▼:diamonds:▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄:heart::slight_smile:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

∟↔◄↓↔♀↕←↔♀◄▼ ∟♥←♀↕←↔♀◄▼♣ ∟♥↑♀

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

§ ◄:spades:▲R#\:diamonds:↑ ]BO>:heart:TD]:slight_smile:EXT∟UYE​:heart:TGU​:slight_smile:EXT∟TYE​:heart:TGQ​:slight_smile:EXT∟PYE​:heart:TGP​:slight_smile:EXT∟PY

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:slight_smile:▲§:slight_smile:►:left_right_arrow::arrow_up_down:←∟♀◄▼↓♀ ∟:slight_smile:←♀

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

∟♀◄:heart::left_right_arrow:↨:left_right_arrow::arrow_up_down::left_right_arrow:◄▲♀◄

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

→♀◄▼:left_right_arrow::arrow_up_down: ▲♀

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

File “”, line 1

→♀◄▼↔↕      ▲



^

SyntaxError: invalid syntax

-----.------

◄♠♂R#\◄↑ ]WO>▼B@I♫AGQ

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:heart:▼♀◄ ▲§:left_right_arrow:◄:left_right_arrow::arrow_up_down::left_right_arrow:♀◄:heart::spades: :heart:→♀◄ ▲¶:left_right_arrow:◄:left_right_arrow::arrow_up_down::diamonds::left_right_arrow:♀◄:heart::spades: ∟ ▲▬:left_right_arrow:◄:slight_smile:◄:heart::slight_smile: ∟ ▲◄:left_right_arrow:◄:slight_smile:◄:heart::slight_smile:

▲:arrow_up_down::left_right_arrow:◄:slight_smile:◄:heart::diamonds: ∟ ▲↨:left_right_arrow:◄:slight_smile:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

◄:heart:↓:left_right_arrow::arrow_up_down::diamonds:▲:diamonds:▲§:left_right_arrow::heart::diamonds:↓♀ :heart: ◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :diamonds: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :heart:♀ ◄▼:diamonds::left_right_arrow: ▲§:slight_smile: :heart:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:spades:→:left_right_arrow:◄:spades::left_right_arrow::diamonds::left_right_arrow:↨:left_right_arrow: :slight_smile:←♀ :diamonds::spades:▲:left_right_arrow:◄:spades::left_right_arrow::slight_smile::left_right_arrow:↨:left_right_arrow: :diamonds:←♀ ☼ ◄ :spades::left_right_arrow:◄:spades::left_right_arrow::left_right_arrow:↨:left_right_arrow: ←♀ :slight_smile::slight_smile: ◄ ▼:left_right_arrow:◄

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

∟▲¶:slight_smile:◄:left_right_arrow::arrow_up_down:←:left_right_arrow:♀ ▲§:slight_smile:◄:left_right_arrow::arrow_up_down:→:left_right_arrow:♀◄▼:diamonds: ∟:heart:↑♀

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

◄▼▲ ▲▬:left_right_arrow::heart::clubs:→♀ ◄:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:

→♀∟:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:→♀∟:heart::diamonds:▲:left_right_arrow::arrow_up_down:←:left_right_arrow::heart::slight_smile:→♀∟:heart::diamonds:∟:left_right_arrow::arrow_up_down:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

7aqw ``t%yle&~ti7}rp;lmt%tle:}rs;lmt%yle:}rv;lmt%~le:}rt;lmt&ule:}

q};lmt&ule:}ru;lmt%~le:}rp;lmt%tle&~vi7

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

File “”, line 1

7aqw ``t%yle&~ti7}rp;lmt%tle:}rs;lmt%yle:}rv;lmt%~le:}rt;lmt&ule:}

q};lmt&ule:}ru;lmt%~le:}rp;lmt%tle&~vi7

   ^

SyntaxError: invalid syntax

-----.------

%~le&~ri7}rv;lqw"t%yle&~vi7}rs;lqw#t%~le&}yi7}q|;lqt ``t&yle&}ui7}

qs;lqt!t&{le&}yi7}rt;lqw&t%~le&~ri7}rw;lqw

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

File “”, line 1

%~le&~ri7}rv;lqw"``t%yle&~vi7}rs;lqw#``t%~le&}yi7}q|;lqt ``t&yle&}

ui7}qs;lqt!t&{le&}yi7}rt;lqw&t%~le&~ri7}rw;lqw

^

SyntaxError: invalid syntax

-----.------

◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:spades:▲§:left_right_arrow::heart:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:heart::slight_smile::left_right_arrow:♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:◄:clubs:▼♀◄:heart::diamonds: :heart::slight_smile:¶♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:

▼♀◄ :heart: :heart::slight_smile:▼♀:arrow_up_down::slight_smile:▲▬▲:bangbang::slight_smile::diamonds: ▼:slight_smile:▲¶▲

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:spades::slight_smile:◄:heart::spades:§:left_right_arrow::arrow_up_down::spades:∟:spades:▲↨∟ :diamonds:←▼:diamonds:▲↨∟:heart::spades:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

♀◄:heart::arrow_up_down::left_right_arrow::arrow_up_down:▲§◄ ♂↓ :heart:♀♀◄:heart::diamonds:↓:left_right_arrow::arrow_up_down:▲§◄:heart::heart:↓ ♀◄:heart:§:left_right_arrow::arrow_up_down::diamonds::arrow_up_down:▲§◄:heart::clubs:↓ ∟:heart:↨:left_right_arrow::arrow_up_down:↑◄:heart:↓ ∟:heart:§:left_right_arrow::arrow_up_down:↑◄:heart::diamonds:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

§♀◄ :left_right_arrow:↑:left_right_arrow:◄:left_right_arrow:◄ :left_right_arrow:♀◄ ←♀◄ :left_right_arrow:↨:left_right_arrow:◄:left_right_arrow::arrow_up_down::slight_smile::left_right_arrow:♀◄:heart::diamonds: ∟ ▲

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

▼▲↨▲▬:slight_smile:◄ :heart: ▼▲§▲▬:slight_smile:◄ :heart: ▼▲▬▲▬:slight_smile:◄ :slight_smile: :heart::diamonds:→♀:arrow_up_down:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

    ▲‼☺↑☺◄▼☼  ∟



    ↔↨☺↑↔◄↓¶♀◄▼       ∟     §♀

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

0 Likes

#3

Hi,

I was thinking about your post about two days ago, and it crossed my mind that the issue could be a bytearray vs string issue.

I assume that the data you are sending is meant to be a stream of binary values, an array of bytes. It could be that for some reason autobahn is thinking that you are attemting to transfer an array of chars, and then occasionally “” followed by “u” get transferred, and it thinks that it is a unicode encoded string and attempts to convert it somehow and then fails. Or some other escape sequences occur which only have a meaning in a character array but should be ignored in a byte array.

I’d label that as a hunch and would start digging in that direction, checking out the problems which could arise when you use a character based transfer mode vs a binary one. I’,m saying that because I remember seeing some onBinaryMessage stuff in the api. Then I’d check if I’m really transferring that data in a binary mode, and if none exists, which I don’t believe, I’d base64 encode the data first and check if that solves the problem (which as a drawback would increase the transferred amount of data a lot)

Kind regards,

Daniel

···

2012/4/9 Michel Cânovas michelm...@gmail.com

Hello again!

I know there is a lot to do regarding this platform, and a lot of requests to handle, but I would like to have some feedback concerning my post. Mainly know if I have been clear exposing the problem, or/and, if there is actually anyone looking at this, if the problem can be solved.

Thank you very much for the attention,

Best regards

Michel Cânovas

No dia 5 de Abril de 2012 12:56, Michel Cânovas michelm...@gmail.com escreveu:

Hi!

I’m using Autobahn ws in an app that does real time signal acquisition

and processing. The client side is an Android device that gathers the

signal at a sampling rate of 1000Hz and transmits 100 samples every

0.1s. On the server side, it is supposed to receive the signal and

retrieve a filtered version back to the Android.

Everything works fine, except once in a while, when the server

receives a message which it cannot decode. All the sent messages have

the same valid structure, but every once in a while the server finds

an error which I can’t ignore since it would mean data loss.

I don’t know if it is related with the message size, or rate. I’d like

to understand what happens if I try to send a message through an

Autobahn ws whilst it is sending a previous one. Could this be the

case?

I’ll just leave one server side log below, where it’s printed every

received message and the error, if there is one.

Thank you in advance,

Michel Cânovas

Note: the first two results are the last ones to be as they should.

Separator: -----.------

The correct message has the following structure:

CMDqueue.put({‘Frames’: […]})

Log result:

CMDqueue.put({‘Frames’:[-128, 125, 122, 119, 118, 119, 121, 125, -128,

-126, -123, -121, -120, -119, -120, -121, -123, -125, -127,

-128, 126, 124, 121, 121, 122, 124, 126, 127, -128, -125, -124, -124,

-122, -120, -119, -120, -122, -123, -125, -128, -128, -127,

-127, 125, 122, 122, 123, 122, 121, 121, 123, 126, -127, -125, -124,

-124, -126, -127, -128, 127, 126, 124, 121, 120, 121, 122, 1

22, 121, 122, 125, -127, -124, -123, -125, -125, -126, -125, -126,

127, 125, 123, 123, 122, 120, 118, 117, 119, 121, 124, 127, -12

7, -128, 127, 127, -128, -127, -127, -128, 126, 123]})

-----.------

CMDqueue.put({‘Frames’:[121, 122, 122, 122, 122, 123, 124, 125, 125,

126, 127, -128, -127, -126, -126, -126, -127, -127, -128, 126

, 126, 125, 122, 121, 121, 121, 120, 119, 119, 123, 126, 127, -126,

-126, -128, 127, 127, 127, -128, -127, -127, 127, 125, 125, 12

5, 126, 127, -127, -125, -123, -121, -119, -117, -115, -113, -110,

-108, -107, -108, -112, -115, -115, -115, -116, -117, -118, -11

9, -120, -121, -122, -123, -123, -123, -123, -123, -124, -125, -127,

126, 124, 121, 116, 111, 105, 102, 100, 100, 102, 105, 108, 1

10, 113, 115, 117, 117, 116, 117, 119, 121, 120]})

-----.------

M​:left_right_arrow: O\:slight_smile: QK​:heart:◄NM​:left_right_arrow:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow: O\:slight_smile: QM​:heart:◄NM​:left_right_arrow: O\:slight_smile: QN​:heart:◄NM​:left_right_arrow::heart:O\:slight_smile: QH​:heart:◄NM​:left_right_arrow::spades:O

\▲♥UP☼ QH♥◄RN→

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

M▲ O\:slight_smile: RE​:heart:◄NM​:left_right_arrow::slight_smile:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow:O\▲:heart:TP☼ QI​:heart:◄RN←:left_right_arrow:CM​:left_right_arrow::clubs:O\▲:heart:PP☼ QH​:heart:◄RN←:left_right_arrow:CM​:left_right_arrow:O

\:slight_smile: QD​:heart:◄RN↑

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:slight_smile:◄▼▲► :slight_smile:◄▼▲► :slight_smile::slight_smile:◄▼:slight_smile:▼:diamonds:▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄:heart::slight_smile:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

∟↔◄↓↔♀↕←↔♀◄▼ ∟♥←♀↕←↔♀◄▼♣ ∟♥↑♀

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

§ ◄:spades:▲R#\:diamonds:↑ ]BO>:heart:TD]:slight_smile:EXT∟UYE​:heart:TGU​:slight_smile:EXT∟TYE​:heart:TGQ​:slight_smile:EXT∟PYE​:heart:TGP​:slight_smile:EXT∟PY

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:slight_smile:▲§:slight_smile:►:left_right_arrow::arrow_up_down:←∟♀◄▼↓♀ ∟:slight_smile:←♀

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

∟♀◄:heart::left_right_arrow:↨:left_right_arrow::arrow_up_down::left_right_arrow:◄▲♀◄

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

→♀◄▼:left_right_arrow::arrow_up_down: ▲♀

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

File “”, line 1

→♀◄▼↔↕      ▲



^

SyntaxError: invalid syntax

-----.------

◄♠♂R#\◄↑ ]WO>▼B@I♫AGQ

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:heart:▼♀◄ ▲§:left_right_arrow:◄:left_right_arrow::arrow_up_down::left_right_arrow:♀◄:heart::spades: :heart:→♀◄ ▲¶:left_right_arrow:◄:left_right_arrow::arrow_up_down::diamonds::left_right_arrow:♀◄:heart::spades: ∟ ▲▬:left_right_arrow:◄:slight_smile:◄:heart::slight_smile: ∟ ▲◄:left_right_arrow:◄:slight_smile:◄:heart::slight_smile:

▲:arrow_up_down::left_right_arrow:◄:slight_smile:◄:heart::diamonds: ∟ ▲↨:left_right_arrow:◄:slight_smile:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

◄:heart:↓:left_right_arrow::arrow_up_down::diamonds:▲:diamonds:▲§:left_right_arrow::heart::diamonds:↓♀ :heart: ◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :diamonds: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :heart:♀ ◄▼:diamonds::left_right_arrow: ▲§:slight_smile: :heart:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:spades:→:left_right_arrow:◄:spades::left_right_arrow::diamonds::left_right_arrow:↨:left_right_arrow: :slight_smile:←♀ :diamonds::spades:▲:left_right_arrow:◄:spades::left_right_arrow::slight_smile::left_right_arrow:↨:left_right_arrow: :diamonds:←♀ ☼ ◄ :spades::left_right_arrow:◄:spades::left_right_arrow::left_right_arrow:↨:left_right_arrow: ←♀ :slight_smile::slight_smile: ◄ ▼:left_right_arrow:◄

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

∟▲¶:slight_smile:◄:left_right_arrow::arrow_up_down:←:left_right_arrow:♀ ▲§:slight_smile:◄:left_right_arrow::arrow_up_down:→:left_right_arrow:♀◄▼:diamonds: ∟:heart:↑♀

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

◄▼▲ ▲▬:left_right_arrow::heart::clubs:→♀ ◄:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:

→♀∟:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:→♀∟:heart::diamonds:▲:left_right_arrow::arrow_up_down:←:left_right_arrow::heart::slight_smile:→♀∟:heart::diamonds:∟:left_right_arrow::arrow_up_down:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

7aqw ``t%yle&~ti7}rp;lmt%tle:}rs;lmt%yle:}rv;lmt%~le:}rt;lmt&ule:}

q};lmt&ule:}ru;lmt%~le:}rp;lmt%tle&~vi7

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

File “”, line 1

7aqw ``t%yle&~ti7}rp;lmt%tle:}rs;lmt%yle:}rv;lmt%~le:}rt;lmt&ule:}

q};lmt&ule:}ru;lmt%~le:}rp;lmt%tle&~vi7

   ^

SyntaxError: invalid syntax

-----.------

%~le&~ri7}rv;lqw"t%yle&~vi7}rs;lqw#t%~le&}yi7}q|;lqt ``t&yle&}ui7}

qs;lqt!t&{le&}yi7}rt;lqw&t%~le&~ri7}rw;lqw

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

File “”, line 1

%~le&~ri7}rv;lqw"``t%yle&~vi7}rs;lqw#``t%~le&}yi7}q|;lqt ``t&yle&}

ui7}qs;lqt!t&{le&}yi7}rt;lqw&t%~le&~ri7}rw;lqw

^

SyntaxError: invalid syntax

-----.------

◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:spades:▲§:left_right_arrow::heart:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:heart::slight_smile::left_right_arrow:♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:◄:clubs:▼♀◄:heart::diamonds: :heart::slight_smile:¶♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:

▼♀◄ :heart: :heart::slight_smile:▼♀:arrow_up_down::slight_smile:▲▬▲:bangbang::slight_smile::diamonds: ▼:slight_smile:▲¶▲

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

:spades::slight_smile:◄:heart::spades:§:left_right_arrow::arrow_up_down::spades:∟:spades:▲↨∟ :diamonds:←▼:diamonds:▲↨∟:heart::spades:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

♀◄:heart::arrow_up_down::left_right_arrow::arrow_up_down:▲§◄ ♂↓ :heart:♀♀◄:heart::diamonds:↓:left_right_arrow::arrow_up_down:▲§◄:heart::heart:↓ ♀◄:heart:§:left_right_arrow::arrow_up_down::diamonds::arrow_up_down:▲§◄:heart::clubs:↓ ∟:heart:↨:left_right_arrow::arrow_up_down:↑◄:heart:↓ ∟:heart:§:left_right_arrow::arrow_up_down:↑◄:heart::diamonds:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

§♀◄ :left_right_arrow:↑:left_right_arrow:◄:left_right_arrow:◄ :left_right_arrow:♀◄ ←♀◄ :left_right_arrow:↨:left_right_arrow:◄:left_right_arrow::arrow_up_down::slight_smile::left_right_arrow:♀◄:heart::diamonds: ∟ ▲

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

▼▲↨▲▬:slight_smile:◄ :heart: ▼▲§▲▬:slight_smile:◄ :heart: ▼▲▬▲▬:slight_smile:◄ :slight_smile: :heart::diamonds:→♀:arrow_up_down:

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

-----.------

    ▲‼☺↑☺◄▼☼  ∟



    ↔↨☺↑↔◄↓¶♀◄▼       ∟     §♀

Traceback (most recent call last):

File “pywio.py”, line 10, in evaluate

res=eval(req)

TypeError: expected string without null bytes

0 Likes

#4

Hi Michel,

sorry, wasn't meant to ignore, but we are right before a release ..

Need more info:

You are using Autobahn Android as client, connected to Autobahn Python as server?

Are you using plain WebSocket or WAMP?

If plain WebSocket, text or binary messages?

Can you post the Java code you use to serialize your sample data?

On the Python side (in onMessage), before doing the eval() that fails, could you insert code like:

print msg, is_binary, binascii.b2a_hex(msg)

A general hint: using eval() to "deserialize" data in Python is
a security problem, and probably also not very performant. Have you
thought about using JSON? AutobahnAndroid already has a dependency
on Jackson .. either use that together with raw text WS, or use WAMP ..

Or use a binary packaging with raw binary WS and use the struct.unpack()
stuff in Python.

I try to respond quicker this time;)

Tobias

···

Am 09.04.2012 19:27, schrieb Michel Cânovas:

Hello again!

I know there is a lot to do regarding this platform, and a lot of
requests to handle, but I would like to have some feedback concerning my
post. Mainly know if I have been clear exposing the problem, or/and, if
there is actually anyone looking at this, if the problem can be solved.

Thank you very much for the attention,

Best regards
Michel Cânovas

No dia 5 de Abril de 2012 12:56, Michel Cânovas
<michelm...@gmail.com <mailto:michelm...@gmail.com>> escreveu:

    Hi!

    I'm using Autobahn ws in an app that does real time signal acquisition
    and processing. The client side is an Android device that gathers the
    signal at a sampling rate of 1000Hz and transmits 100 samples every
    0.1s. On the server side, it is supposed to receive the signal and
    retrieve a filtered version back to the Android.

    Everything works fine, except once in a while, when the server
    receives a message which it cannot decode. All the sent messages have
    the same valid structure, but every once in a while the server finds
    an error which I can't ignore since it would mean data loss.

    I don't know if it is related with the message size, or rate. I'd like
    to understand what happens if I try to send a message through an
    Autobahn ws whilst it is sending a previous one. Could this be the
    case?

    I'll just leave one server side log below, where it's printed every
    received message and the error, if there is one.

    Thank you in advance,

    Michel Cânovas

    Note: the first two results are the last ones to be as they should.
      Separator: -----.------
      The correct message has the following structure:
    CMDqueue.put({'Frames': [...]})

    Log result:

    CMDqueue.put({'Frames':[-128, 125, 122, 119, 118, 119, 121, 125, -128,
    -126, -123, -121, -120, -119, -120, -121, -123, -125, -127,

    -128, 126, 124, 121, 121, 122, 124, 126, 127, -128, -125, -124, -124,
    -122, -120, -119, -120, -122, -123, -125, -128, -128, -127,

    -127, 125, 122, 122, 123, 122, 121, 121, 123, 126, -127, -125, -124,
    -124, -126, -127, -128, 127, 126, 124, 121, 120, 121, 122, 1

    22, 121, 122, 125, -127, -124, -123, -125, -125, -126, -125, -126,
    127, 125, 123, 123, 122, 120, 118, 117, 119, 121, 124, 127, -12

    7, -128, 127, 127, -128, -127, -127, -128, 126, 123]})

    -----.------

    CMDqueue.put({'Frames':[121, 122, 122, 122, 122, 123, 124, 125, 125,
    126, 127, -128, -127, -126, -126, -126, -127, -127, -128, 126

    , 126, 125, 122, 121, 121, 121, 120, 119, 119, 123, 126, 127, -126,
    -126, -128, 127, 127, 127, -128, -127, -127, 127, 125, 125, 12

    5, 126, 127, -127, -125, -123, -121, -119, -117, -115, -113, -110,
    -108, -107, -108, -112, -115, -115, -115, -116, -117, -118, -11

    9, -120, -121, -122, -123, -123, -123, -123, -123, -124, -125, -127,
    126, 124, 121, 116, 111, 105, 102, 100, 100, 102, 105, 108, 1

    10, 113, 115, 117, 117, 116, 117, 119, 121, 120]})

    -----.------

    M​:left_right_arrow: O\:slight_smile: QK​:heart:◄NM​:left_right_arrow:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow: O\:slight_smile: QM​:heart:◄NM​:left_right_arrow: O\:slight_smile: QN​:heart:◄NM​:left_right_arrow::heart:O\:slight_smile: QH​:heart:◄NM​:left_right_arrow::spades:O
    \▲♥UP☼ QH♥◄RN→

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    M▲ O\:slight_smile: RE​:heart:◄NM​:left_right_arrow::slight_smile:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow:O\▲:heart:TP☼ QI​:heart:◄RN←:left_right_arrow:CM​:left_right_arrow::clubs:O\▲:heart:PP☼ QH​:heart:◄RN←:left_right_arrow:CM​:left_right_arrow:O
    \:slight_smile: QD​:heart:◄RN↑

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    :slight_smile:◄▼▲► :slight_smile:◄▼▲► :slight_smile::slight_smile:◄▼:slight_smile:▼:diamonds:▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄:heart::slight_smile:

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    ∟↔◄↓↔♀↕←↔♀◄▼ ∟♥←♀↕←↔♀◄▼♣ ∟♥↑♀

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    § ◄:spades:▲R#\:diamonds:↑ ]BO>:heart:TD]:slight_smile:EXT∟UYE​:heart:TGU​:slight_smile:EXT∟TYE​:heart:TGQ​:slight_smile:EXT∟PYE​:heart:TGP​:slight_smile:EXT∟PY

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    :slight_smile:▲§:slight_smile:►:left_right_arrow::arrow_up_down:←∟♀◄▼↓♀ ∟:slight_smile:←♀

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

      ∟♀◄:heart::left_right_arrow:↨:left_right_arrow::arrow_up_down::left_right_arrow:◄▲♀◄

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    →♀◄▼:left_right_arrow::arrow_up_down: ▲♀

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

      File "<string>", line 1

        →♀◄▼:left_right_arrow::arrow_up_down:

        ^

    SyntaxError: invalid syntax

    -----.------

    ◄♠♂R#\◄↑ ]WO>▼B@I♫AGQ

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    :heart:▼♀◄ ▲§:left_right_arrow:◄:left_right_arrow::arrow_up_down::left_right_arrow:♀◄:heart::spades: :heart:→♀◄ ▲¶:left_right_arrow:◄:left_right_arrow::arrow_up_down::diamonds::left_right_arrow:♀◄:heart::spades: ∟ ▲▬:left_right_arrow:◄:slight_smile:◄:heart::slight_smile: ∟ ▲◄:left_right_arrow:◄:slight_smile:◄:heart::slight_smile:
    ▲:arrow_up_down::left_right_arrow:◄:slight_smile:◄:heart::diamonds: ∟ ▲↨:left_right_arrow:◄:slight_smile:

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    ◄:heart:↓:left_right_arrow::arrow_up_down::diamonds:▲:diamonds:▲§:left_right_arrow::heart::diamonds:↓♀ :heart: ◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :diamonds: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :heart:♀ ◄▼:diamonds::left_right_arrow: ▲§:slight_smile: :heart:

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    ◄ :spades:→:left_right_arrow:◄:spades::left_right_arrow::diamonds::left_right_arrow:↨:left_right_arrow: :slight_smile:←♀ :diamonds::spades:▲:left_right_arrow:◄:spades::left_right_arrow::slight_smile::left_right_arrow:↨:left_right_arrow: :diamonds:←♀ ☼ ◄ :spades::left_right_arrow:◄:spades::left_right_arrow::left_right_arrow:↨:left_right_arrow: ←♀ :slight_smile::slight_smile: ◄ ▼:left_right_arrow:◄

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    ∟▲¶:slight_smile:◄:left_right_arrow::arrow_up_down:←:left_right_arrow:♀ ▲§:slight_smile:◄:left_right_arrow::arrow_up_down:→:left_right_arrow:♀◄▼:diamonds: ∟:heart:↑♀

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    ◄▼▲ ▲▬:left_right_arrow::heart::clubs:→♀ ◄:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:

    →♀∟:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:→♀∟:heart::diamonds:▲:left_right_arrow::arrow_up_down:←:left_right_arrow::heart::slight_smile:→♀∟:heart::diamonds:∟:left_right_arrow::arrow_up_down:

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    7aqw ``t%yle&~ti7}rp;lmt%tle:}rs;lmt%yle:}rv;lmt%~le:}rt;lmt&ule:}
    q};lmt&ule:}ru;lmt%~le:}rp;lmt%tle&~vi7

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

      File "<string>", line 1

        7aqw ``t%yle&~ti7}rp;lmt%tle:}rs;lmt%yle:}rv;lmt%~le:}rt;lmt&ule:}
    q};lmt&ule:}ru;lmt%~le:}rp;lmt%tle&~vi7

           ^

    SyntaxError: invalid syntax

    -----.------

    %~le&~ri7}rv;lqw"``t%yle&~vi7}rs;lqw#``t%~le&}yi7}q|;lqt ``t&yle&}ui7}
    qs;lqt!``t&{le&}yi7}rt;lqw&``t%~le&~ri7}rw;lqw

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

      File "<string>", line 1

        %~le&~ri7}rv;lqw"``t%yle&~vi7}rs;lqw#``t%~le&}yi7}q|;lqt ``t&yle&}
    ui7}qs;lqt!``t&{le&}yi7}rt;lqw&``t%~le&~ri7}rw;lqw

        ^

    SyntaxError: invalid syntax

    -----.------

      ◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:spades:▲§:left_right_arrow::heart:

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    :heart::slight_smile::left_right_arrow:♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:◄:clubs:▼♀◄:heart::diamonds: :heart::slight_smile:¶♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:

    ▼♀◄ :heart: :heart::slight_smile:▼♀:arrow_up_down::slight_smile:▲▬▲:bangbang::slight_smile::diamonds: ▼:slight_smile:▲¶▲

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

      :spades::slight_smile:◄:heart::spades:§:left_right_arrow::arrow_up_down::spades:∟:spades:▲↨∟ :diamonds:←▼:diamonds:▲↨∟:heart::spades:

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    ♀◄:heart::arrow_up_down::left_right_arrow::arrow_up_down:▲§◄ ♂↓ :heart:♀♀◄:heart::diamonds:↓:left_right_arrow::arrow_up_down:▲§◄:heart::heart:↓ ♀◄:heart:§:left_right_arrow::arrow_up_down::diamonds::arrow_up_down:▲§◄:heart::clubs:↓ ∟:heart:↨:left_right_arrow::arrow_up_down:↑◄:heart:↓ ∟:heart:§:left_right_arrow::arrow_up_down:↑◄:heart::diamonds:

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    §♀◄ :left_right_arrow:↑:left_right_arrow:◄:left_right_arrow:◄ :left_right_arrow:♀◄ ←♀◄ :left_right_arrow:↨:left_right_arrow:◄:left_right_arrow::arrow_up_down::slight_smile::left_right_arrow:♀◄:heart::diamonds: ∟ ▲

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

    ▼▲↨▲▬:slight_smile:◄ :heart: ▼▲§▲▬:slight_smile:◄ :heart: ▼▲▬▲▬:slight_smile:◄ :slight_smile: :heart::diamonds:→♀:arrow_up_down:

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

    -----.------

            ▲:bangbang::slight_smile:↑:slight_smile:◄▼☼ ∟

            ↔↨☺↑↔◄↓¶♀◄▼ ∟ §♀

    Traceback (most recent call last):

      File "pywio.py", line 10, in evaluate

        res=eval(req)

    TypeError: expected string without null bytes

0 Likes

#5

Thank you Daniel, but the whole message is a String. What happens is that, that String has a command to be evaluated by python server “as it is”, so when the message that has been encoded by the websocket, on client side, is being decoded on the server side, turns into hearts and smiles, which python cannot evaluate, thus failing.

Tobias:

You are using Autobahn Android as client, connected to Autobahn Python as server?

I’m using Autobahn Android as client and a custom Python server.

Are you using plain WebSocket or WAMP?

Plain Websocket it is.

If plain WebSocket, text or binary messages?

For now, text messages.

Can you post the Java code you use to serialize your sample data?

I think I did not understand the question… I build a hard-code-like String containing a command and its arguments to be evaluated by the server (enabling me to have a blind dumb server). The Autobahn ws is inside a wrapper class which has a handler to deal with other system’s messages to be sent to the server:

@Override

	public Handler onResult() {

		if(this.mOnResultHandler==null){

			mOnResultHandler= new Handler(){

				@Override

				public void handleMessage(Message msg)

				{

					String messageTag="ResultCh"+msg.what;

					switch (msg.what)

					{

					case 0:

						String data = msg.getData().getString(messageTag);

						**String pyFormatSample="CMDqueue.put({'Frames':["+data+"]})";**

** mConnection.sendTextMessage(pyFormatSample);**

						Log.i(TAG,data);

						break;

				(...)

A general hint: using eval() to “deserialize” data in Python is

a security problem, and probably also not very performant. Have you

thought about using JSON? AutobahnAndroid already has a dependency

on Jackson … either use that together with raw text WS, or use WAMP …

I read a little more about WAMP after your reply and I think it would really be more useful considering what I want to do. Nevertheless, I would like to understand what is happening with my implementation: first because I think it should work (and most of the time it does) and second, because WAMP implementation means considerable changes both on client and server sides (and I really need to get this working as soon as possible:). But yes, I think that, ultimately, I’ll end up implementing WAMP…

I have a concern, though: In some other part of my application I use Jackson to instantiate objects from files (containing JSON structures) and, although it is very useful, it is also a lot time consuming. Where I use it, it is not very harmful because I only do it once, at onCreate(), but in real time data processing at such high rates (even more on a smartphone), i don’t think it would perform well. I mean, with a plain websocket I get the messages as they are, and I know how they are. Using WAMP in a pubsub configuration, for example, I always have to “coerce” the messages into WhateverClass.Class before I can use them. Is there a way to avoid this? I don’t know if I have been clear. Also, forgive me if I’m making assumptions that are not, I’m new to most of this technologies, so I’m still trying to get some grip to them. :slight_smile:

Thank you very much for your time!

Best regards,

Michel Cânovas

···

Am 09.04.2012 19:27, schrieb Michel Cânovas:

Hello again!

I know there is a lot to do regarding this platform, and a lot of

requests to handle, but I would like to have some feedback concerning my

post. Mainly know if I have been clear exposing the problem, or/and, if

there is actually anyone looking at this, if the problem can be solved.

Thank you very much for the attention,

Best regards

Michel Cânovas

No dia 5 de Abril de 2012 12:56, Michel Cânovas

<michelm...@gmail.com mailto:michelmcanovas@gmail.com> escreveu:

Hi!



I'm using Autobahn ws in an app that does real time signal acquisition

and processing. The client side is an Android device that gathers the

signal at a sampling rate of 1000Hz and transmits 100 samples every

0.1s. On the server side, it is supposed to receive the signal and

retrieve a filtered version back to the Android.



Everything works fine, except once in a while, when the server

receives a message which it cannot decode. All the sent messages have

the same valid structure, but every once in a while the server finds

an error which I can't ignore since it would mean data loss.



I don't know if it is related with the message size, or rate. I'd like

to understand what happens if I try to send a message through an

Autobahn ws whilst it is sending a previous one. Could this be the

case?



I'll just leave one server side log below, where it's printed every

received message and the error, if there is one.



Thank you in advance,



Michel Cânovas







Note: the first two results are the last ones to be as they should.

  Separator: -----.------

  The correct message has the following structure:

CMDqueue.put({'Frames': [...]})



Log result:



CMDqueue.put({'Frames':[-128, 125, 122, 119, 118, 119, 121, 125, -128,

-126, -123, -121, -120, -119, -120, -121, -123, -125, -127,



-128, 126, 124, 121, 121, 122, 124, 126, 127, -128, -125, -124, -124,

-122, -120, -119, -120, -122, -123, -125, -128, -128, -127,



-127, 125, 122, 122, 123, 122, 121, 121, 123, 126, -127, -125, -124,

-124, -126, -127, -128, 127, 126, 124, 121, 120, 121, 122, 1



22, 121, 122, 125, -127, -124, -123, -125, -125, -126, -125, -126,

127, 125, 123, 123, 122, 120, 118, 117, 119, 121, 124, 127, -12



7, -128, 127, 127, -128, -127, -127, -128, 126, 123]})



-----.------



CMDqueue.put({'Frames':[121, 122, 122, 122, 122, 123, 124, 125, 125,

126, 127, -128, -127, -126, -126, -126, -127, -127, -128, 126



, 126, 125, 122, 121, 121, 121, 120, 119, 119, 123, 126, 127, -126,

-126, -128, 127, 127, 127, -128, -127, -127, 127, 125, 125, 12



5, 126, 127, -127, -125, -123, -121, -119, -117, -115, -113, -110,

-108, -107, -108, -112, -115, -115, -115, -116, -117, -118, -11



9, -120, -121, -122, -123, -123, -123, -123, -123, -124, -125, -127,

126, 124, 121, 116, 111, 105, 102, 100, 100, 102, 105, 108, 1



10, 113, 115, 117, 117, 116, 117, 119, 121, 120]})



-----.------



M↔      O\☻ QK♥◄NM↔O\☻ QO♥◄NM↔ O\☻ QM♥◄NM↔ O\☻ QN♥◄NM↔♥O\☻ QH♥◄NM↔♠O

\▲♥UP☼ QH♥◄RN→



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



M▲      O\☻ RE♥◄NM↔☺O\☻ QO♥◄NM↔O\▲♥TP☼ QI♥◄RN←↔CM↔♣O\▲♥PP☼ QH♥◄RN←↔CM↔O

\☻ QD♥◄RN↑



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



☺◄▼▲► ☺◄▼▲►   ☺☺◄▼☺▼♦▲► ☺◄▼☺▼   ▲► ☺◄▼☺▼        ▲► ☺◄♥☻→



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



∟↔◄↓↔♀↕←↔♀◄▼  ∟♥←♀↕←↔♀◄▼♣  ∟♥↑♀



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



§ ◄♠▲R#\♦↑ ]BO>♥TD]☻EXT∟UYE♥TGU☻EXT∟TYE♥TGQ☻EXT∟PYE♥TGP☻EXT∟PY



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



☺▲§☺►↔↕←∟♀◄▼↓♀ ∟☻←♀



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



  ∟♀◄♥↔↨↔↕↔◄▲♀◄



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



→♀◄▼↔↕  ▲♀



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



  File "<string>", line 1



    →♀◄▼↔↕      ▲



    ^



SyntaxError: invalid syntax



-----.------



◄♠♂R#\◄↑ ]WO>▼B@I♫AGQ



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



♥▼♀◄ ▲§↔◄↔↕↔♀◄♥♠   ♥→♀◄ ▲¶↔◄↔↕♦↔♀◄♥♠  ∟ ▲▬↔◄☺◄♥☻  ∟ ▲◄↔◄☺◄♥☺  ∟

▲↕↔◄☺◄♥♦  ∟ ▲↨↔◄☺



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes



-----.------



◄♥↓↔↕♦▲♦▲§↔♥♦↓♀  ♥ ◄▼♦▲ ▲§☺  ♥ ◄▼♦▲☻▲§☺  ♦ ◄▼♦▲☺▲§☺ ♥♀ ◄▼♦↔     ▲§☺ ♥



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



◄ ♠→↔◄♠↔♦↔↨↔ ☻←♀  ♦ ◄ ♠▲↔◄♠↔☻↔↨↔ ♦←♀  ☼ ◄ ♠¶↔◄♠↔↔↨↔  ←♀ ☺☺ ◄ ▼↔◄



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes



-----.------



∟▲¶☺◄↔↕←↔♀  ▲§☺◄↔↕→↔♀◄▼♦  ∟♥↑♀



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



◄▼▲     ▲▬↔♥♣→♀    ◄♥♦←↔↕←↔♥



→♀∟♥♦←↔↕←↔♥→♀∟♥♦▲↔↕←↔♥☻→♀∟♥♦∟↔↕



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes



-----.------



7aqw ``t%yle&~ti7}rp;lmt%tle:}rs;lmt%yle:}rv;lmt%~le:}rt;lmt&ule:}

q};lmt&ule:}ru;lmt%~le:}rp;lmt%tle&~vi7



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



  File "<string>", line 1



    7aqw ``t%yle&~ti7}rp;lmt%tle:}rs;lmt%yle:}rv;lmt%~le:}rt;lmt&ule:}

q};lmt&ule:}ru;lmt%~le:}rp;lmt%tle&~vi7



       ^



SyntaxError: invalid syntax







-----.------



%~le&~ri7}rv;lqw"``t%yle&~vi7}rs;lqw#``t%~le&}yi7}q|;lqt ``t&yle&}ui7}

qs;lqt!``t&{le&}yi7}rt;lqw&``t%~le&~ri7}rw;lqw



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



  File "<string>", line 1



    %~le&~ri7}rv;lqw"``t%yle&~vi7}rs;lqw#``t%~le&}yi7}q|;lqt ``t&yle&}

ui7}qs;lqt!``t&{le&}yi7}rt;lqw&``t%~le&~ri7}rw;lqw



    ^



SyntaxError: invalid syntax



-----.------



  ◄▼♦▲   ▲§☺  ♥ ◄▼♦▲♠▲§↔♥



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



♥☺↔♀↕☻↔↑▲‼↔◄♣▼♀◄♥♦  ♥☻¶♀↕☻↔↑▲‼↔◄



▼♀◄ ♥  ♥☺▼♀↕☻▲▬▲‼☺◄ ♦  ▼☻▲¶▲



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes



-----.------



  ♠☺◄♥♠§↔↕♠∟♠▲↨∟ ♦←▼♦▲↨∟♥♠←



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes







-----.------



♀◄♥↕↔↕▲§◄ ♂↓  ♥♀♀◄♥♦↓↔↕▲§◄♥♥↓   ♀◄♥§↔↕♦↕▲§◄♥♣↓ ∟♥↨↔↕↑◄♥↓ ∟♥§↔↕↑◄♥♦



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes



-----.------



§♀◄ ↔↑↔◄↔◄      ↔♀◄         ←♀◄ ↔↨↔◄↔↕☺↔♀◄♥♦  ∟ ▲



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes



-----.------



▼▲↨▲▬☺◄ ♥  ▼▲§▲▬☺◄ ♥  ▼▲▬▲▬☺◄ ☺  ♥♦→♀↕



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes



-----.------



        ▲‼☺↑☺◄▼☼  ∟



        ↔↨☺↑↔◄↓¶♀◄▼       ∟     §♀



Traceback (most recent call last):



  File "pywio.py", line 10, in evaluate



    res=eval(req)



TypeError: expected string without null bytes
0 Likes

#6

could you modify your server code for something like

import binascii

    def onMessage(self, msg, binary):
       if not binary:
          try:
             s = msg.decode('utf-8')
             obj = eval(s)
          except Exception, e:
             print e
             print binascii.b2a_hex(msg)

and provide the log output?

···

Am 10.04.2012 13:28, schrieb Michel Cânovas:

Thank you Daniel, but the whole message is a String. What happens is
that, that String has a command to be evaluated by python server "as it
is", so when the message that has been encoded by the websocket, on
client side, is being decoded on the server side, turns into hearts and
smiles, which python cannot evaluate, thus failing.

Tobias:

    You are using Autobahn Android as client, connected to Autobahn
    Python as server?

I'm using Autobahn Android as client and a custom Python server.

    Are you using plain WebSocket or WAMP?

Plain Websocket it is.

    If plain WebSocket, text or binary messages?

For now, text messages.

    Can you post the Java code you use to serialize your sample data?

I think I did not understand the question... I build a hard-code-like
String containing a command and its arguments to be evaluated by the
server (enabling me to have a blind dumb server). The Autobahn ws is
inside a wrapper class which has a handler to deal with other system's
messages to be sent to the server:

                 @Override
public Handler onResult() {
if(this.mOnResultHandler==null){
mOnResultHandler= new Handler(){
@Override
public void handleMessage(Message msg)
{

String messageTag="ResultCh"+msg.what;
switch (msg.what)
{
case 0:
String data = msg.getData().getString(messageTag);
*String pyFormatSample="CMDqueue.put({'Frames':["+data+"]})";*
*mConnection.sendTextMessage(pyFormatSample);*
Log.i(TAG,data);
break;
(...)

    A general hint: using eval() to "deserialize" data in Python is
    a security problem, and probably also not very performant. Have you
    thought about using JSON? AutobahnAndroid already has a dependency
    on Jackson .. either use that together with raw text WS, or use WAMP ..

I read a little more about WAMP after your reply and I think it would
really be more useful considering what I want to do. Nevertheless, I
would like to understand what is happening with my implementation: first
because I think it should work (and most of the time it does) and
second, because WAMP implementation means considerable changes both on
client and server sides (and I really need to get this working as soon
as possible:). But yes, I think that, ultimately, I'll end up
implementing WAMP...
I have a concern, though: In some other part of my application I use
Jackson to instantiate objects from files (containing JSON structures)
and, although it is very useful, it is also a lot time consuming. Where
I use it, it is not very harmful because I only do it once, at
onCreate(), but in real time data processing at such high rates (even
more on a smartphone), i don't think it would perform well. I mean, with
a plain websocket I get the messages as they are, and I know how they
are. Using WAMP in a pubsub configuration, for example, I always have to
"coerce" the messages into WhateverClass.Class before I can use them. Is
there a way to avoid this? I don't know if I have been clear. Also,
forgive me if I'm making assumptions that are not, I'm new to most of
this technologies, so I'm still trying to get some grip to them. :slight_smile:

Thank you very much for your time!

Best regards,
Michel Cânovas

    Am 09.04.2012 19:27, schrieb Michel Cânovas:

        Hello again!

        I know there is a lot to do regarding this platform, and a lot of
        requests to handle, but I would like to have some feedback
        concerning my
        post. Mainly know if I have been clear exposing the problem,
        or/and, if
        there is actually anyone looking at this, if the problem can be
        solved.

        Thank you very much for the attention,

        Best regards
        Michel Cânovas

        No dia 5 de Abril de 2012 12:56, Michel Cânovas
        <michelm...@gmail.com <mailto:michelm...@gmail.com>
        <mailto:michelm...@gmail.__com
        <mailto:michelm...@gmail.com>>> escreveu:

            Hi!

            I'm using Autobahn ws in an app that does real time signal
        acquisition
            and processing. The client side is an Android device that
        gathers the
            signal at a sampling rate of 1000Hz and transmits 100
        samples every
            0.1s. On the server side, it is supposed to receive the
        signal and
            retrieve a filtered version back to the Android.

            Everything works fine, except once in a while, when the server
            receives a message which it cannot decode. All the sent
        messages have
            the same valid structure, but every once in a while the
        server finds
            an error which I can't ignore since it would mean data loss.

            I don't know if it is related with the message size, or
        rate. I'd like
            to understand what happens if I try to send a message through an
            Autobahn ws whilst it is sending a previous one. Could this
        be the
            case?

            I'll just leave one server side log below, where it's
        printed every
            received message and the error, if there is one.

            Thank you in advance,

            Michel Cânovas

            Note: the first two results are the last ones to be as they
        should.
              Separator: -----.------
              The correct message has the following structure:
            CMDqueue.put({'Frames': [...]})

            Log result:

            CMDqueue.put({'Frames':[-128, 125, 122, 119, 118, 119, 121,
        125, -128,
            -126, -123, -121, -120, -119, -120, -121, -123, -125, -127,

            -128, 126, 124, 121, 121, 122, 124, 126, 127, -128, -125,
        -124, -124,
            -122, -120, -119, -120, -122, -123, -125, -128, -128, -127,

            -127, 125, 122, 122, 123, 122, 121, 121, 123, 126, -127,
        -125, -124,
            -124, -126, -127, -128, 127, 126, 124, 121, 120, 121, 122, 1

            22, 121, 122, 125, -127, -124, -123, -125, -125, -126, -125,
        -126,
            127, 125, 123, 123, 122, 120, 118, 117, 119, 121, 124, 127, -12

            7, -128, 127, 127, -128, -127, -127, -128, 126, 123]})

            -----.------

            CMDqueue.put({'Frames':[121, 122, 122, 122, 122, 123, 124,
        125, 125,
            126, 127, -128, -127, -126, -126, -126, -127, -127, -128, 126

            , 126, 125, 122, 121, 121, 121, 120, 119, 119, 123, 126,
        127, -126,
            -126, -128, 127, 127, 127, -128, -127, -127, 127, 125, 125, 12

            5, 126, 127, -127, -125, -123, -121, -119, -117, -115, -113,
        -110,
            -108, -107, -108, -112, -115, -115, -115, -116, -117, -118, -11

            9, -120, -121, -122, -123, -123, -123, -123, -123, -124,
        -125, -127,
            126, 124, 121, 116, 111, 105, 102, 100, 100, 102, 105, 108, 1

            10, 113, 115, 117, 117, 116, 117, 119, 121, 120]})

            -----.------

            M​:left_right_arrow: O\:slight_smile: QK​:heart:◄NM​:left_right_arrow:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow: O\:slight_smile: QM​:heart:◄NM​:left_right_arrow: O\:slight_smile: QN​:heart:◄NM​:left_right_arrow::heart:O\:slight_smile:
        QH​:heart:◄NM​:left_right_arrow::spades:O
            \▲♥UP☼ QH♥◄RN→

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            M▲ O\:slight_smile: RE​:heart:◄NM​:left_right_arrow::slight_smile:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow:O\▲:heart:TP☼ QI​:heart:◄RN←:left_right_arrow:CM​:left_right_arrow::clubs:O\▲:heart:PP☼
        QH♥◄RN←↔CM↔O
            \:slight_smile: QD​:heart:◄RN↑

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            :slight_smile:◄▼▲► :slight_smile:◄▼▲► :slight_smile::slight_smile:◄▼:slight_smile:▼:diamonds:▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄:heart::slight_smile:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ∟↔◄↓↔♀↕←↔♀◄▼ ∟♥←♀↕←↔♀◄▼♣ ∟♥↑♀

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            § ◄:spades:▲R#\:diamonds:↑ ]BO>:heart:TD]:slight_smile:EXT∟UYE​:heart:TGU​:slight_smile:EXT∟TYE​:heart:__TGQ​:slight_smile:EXT∟PYE​:heart:TGP​:slight_smile:EXT∟PY

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            :slight_smile:▲§:slight_smile:►:left_right_arrow::arrow_up_down:←∟♀◄▼↓♀ ∟:slight_smile:←♀

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

              ∟♀◄:heart::left_right_arrow:↨:left_right_arrow::arrow_up_down::left_right_arrow:◄▲♀◄

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            →♀◄▼:left_right_arrow::arrow_up_down: ▲♀

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

              File "<string>", line 1

                →♀◄▼:left_right_arrow::arrow_up_down:

                ^

            SyntaxError: invalid syntax

            -----.------

            ◄♠♂R#\◄↑ ]WO>▼B@I♫AGQ

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            :heart:▼♀◄ ▲§:left_right_arrow:◄:left_right_arrow::arrow_up_down::left_right_arrow:♀◄:heart::spades: :heart:→♀◄ ▲¶:left_right_arrow:◄:left_right_arrow::arrow_up_down::diamonds::left_right_arrow:♀◄:heart::spades: ∟ ▲▬:left_right_arrow:◄:slight_smile:◄:heart::slight_smile: ∟ ▲◄:left_right_arrow:◄:slight_smile:◄:heart::slight_smile:
            ▲:arrow_up_down::left_right_arrow:◄:slight_smile:◄:heart::diamonds: ∟ ▲↨:left_right_arrow:◄:slight_smile:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ◄:heart:↓:left_right_arrow::arrow_up_down::diamonds:▲:diamonds:▲§:left_right_arrow::heart::diamonds:↓♀ :heart: ◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :diamonds: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :heart:♀ ◄▼:diamonds::left_right_arrow:
             ▲§:slight_smile: :heart:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ◄ :spades:→:left_right_arrow:◄:spades::left_right_arrow::diamonds::left_right_arrow:↨:left_right_arrow: :slight_smile:←♀ :diamonds::spades:▲:left_right_arrow:◄:spades::left_right_arrow::slight_smile::left_right_arrow:↨:left_right_arrow: :diamonds:←♀ ☼ ◄ :spades::left_right_arrow:◄:spades::left_right_arrow::left_right_arrow:↨:left_right_arrow: ←♀ :slight_smile::slight_smile: ◄ ▼:left_right_arrow:◄

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ∟▲¶:slight_smile:◄:left_right_arrow::arrow_up_down:←:left_right_arrow:♀ ▲§:slight_smile:◄:left_right_arrow::arrow_up_down:→:left_right_arrow:♀◄▼:diamonds: ∟:heart:↑♀

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ◄▼▲ ▲▬:left_right_arrow::heart::clubs:→♀ ◄:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:

            →♀∟:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:→♀∟:heart::diamonds:▲:left_right_arrow::arrow_up_down:←:left_right_arrow::heart::slight_smile:→♀∟:heart::diamonds:∟:left_right_arrow:__​:arrow_up_down:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            7aqw
        ``t%yle&~ti7}rp;lmt%tle:}rs;__lmt%yle:}rv;lmt%~le:}rt;lmt&__ule:}
            q};lmt&ule:}ru;lmt%~le:}rp;__lmt%tle&~vi7

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

              File "<string>", line 1

                7aqw
        ``t%yle&~ti7}rp;lmt%tle:}rs;__lmt%yle:}rv;lmt%~le:}rt;lmt&__ule:}
            q};lmt&ule:}ru;lmt%~le:}rp;__lmt%tle&~vi7

                   ^

            SyntaxError: invalid syntax

            -----.------

            %~le&~ri7}rv;lqw"``t%yle&~vi7}__rs;lqw#``t%~le&}yi7}q|;lqt
        ``t&yle&}ui7}
            qs;lqt!``t&{le&}yi7}rt;lqw&``__t%~le&~ri7}rw;lqw

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

              File "<string>", line 1

          %~le&~ri7}rv;lqw"``t%yle&~vi7}__rs;lqw#``t%~le&}yi7}q|;lqt
        ``t&yle&}
            ui7}qs;lqt!``t&{le&}yi7}rt;__lqw&``t%~le&~ri7}rw;lqw

                ^

            SyntaxError: invalid syntax

            -----.------

              ◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:spades:▲§:left_right_arrow::heart:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            :heart::slight_smile::left_right_arrow:♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:◄:clubs:▼♀◄:heart::diamonds: :heart::slight_smile:¶♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:

            ▼♀◄ :heart: :heart::slight_smile:▼♀:arrow_up_down::slight_smile:▲▬▲:bangbang::slight_smile::diamonds: ▼:slight_smile:▲¶▲

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

              :spades::slight_smile:◄:heart::spades:§:left_right_arrow::arrow_up_down::spades:∟:spades:▲↨∟ :diamonds:←▼:diamonds:▲↨∟:heart::spades:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ♀◄:heart::arrow_up_down::left_right_arrow::arrow_up_down:▲§◄ ♂↓ :heart:♀♀◄:heart::diamonds:↓:left_right_arrow::arrow_up_down:▲§◄:heart::heart:↓ ♀◄:heart:§:left_right_arrow::arrow_up_down::diamonds::arrow_up_down:▲§◄:heart::clubs:↓ ∟:heart:↨:left_right_arrow::arrow_up_down:↑◄:heart:↓
        ∟:heart:§:left_right_arrow::arrow_up_down:↑◄:heart::diamonds:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            §♀◄ :left_right_arrow:↑:left_right_arrow:◄:left_right_arrow:◄ :left_right_arrow:♀◄ ←♀◄ :left_right_arrow:↨:left_right_arrow:◄:left_right_arrow::arrow_up_down::slight_smile::left_right_arrow:♀◄:heart::diamonds: ∟ ▲

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ▼▲↨▲▬:slight_smile:◄ :heart: ▼▲§▲▬:slight_smile:◄ :heart: ▼▲▬▲▬:slight_smile:◄ :slight_smile: :heart::diamonds:→♀:arrow_up_down:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

                    ▲:bangbang::slight_smile:↑:slight_smile:◄▼☼ ∟

                    ↔↨☺↑↔◄↓¶♀◄▼ ∟ §♀

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

0 Likes

#7

    You are using Autobahn Android as client, connected to Autobahn
    Python as server?

I'm using Autobahn Android as client and a custom Python server.

Sorry (overread that): you are NOT using Autobahn as server, but something else, but also Python based?

Why?

But anyway: why are you asking here?

0 Likes

#8

I asked here because I thought the problem was on the client side.

My server was working well when communicating with the browser version. I only started using Autobahn ws to implement a client app in Android, then the trouble started. But now I understand that the way I was using the ws Server to communicate with the browser was masking an error on server side that I just found out. Now I’m integrating Autobahn ws into the server side, let’s see how it works…

Thank you for your quick replies, they have been a great help! Could you just answer my previous question about WAMP? I’m considering that implementation on a future version of my app…

Thank you for your time and patience!

Regards,

Michel Cânovas

No dia 10 de Abril de 2012 14:53, Tobias Oberstein tobias.o...@gmail.com escreveu:

···

You are using Autobahn Android as client, connected to Autobahn

Python as server?

I’m using Autobahn Android as client and a custom Python server.

Sorry (overread that): you are NOT using Autobahn as server, but something else, but also Python based?

Why?

But anyway: why are you asking here?

0 Likes

#9

I have a concern, though: In some other part of my application I use
Jackson to instantiate objects from files (containing JSON structures)
and, although it is very useful, it is also a lot time consuming. Where
I use it, it is not very harmful because I only do it once, at
onCreate(), but in real time data processing at such high rates (even
more on a smartphone), i don't think it would perform well. I mean, with

Assuming you have read your sample data into some native Java int[] or byte[] array.

Serializing this into a string using some adhoc approach vs serializing
into JSON using Jackson won't make a huge difference performance wise.
This is a rough guess / gut feeling of course.

a plain websocket I get the messages as they are, and I know how they
are. Using WAMP in a pubsub configuration, for example, I always have to
"coerce" the messages into WhateverClass.Class before I can use them. Is

You can just coerce into String (and do your thing as today) or you can
"coerce" into Object.class, which effectively makes Jackson assume
"associative arrays / dicts" JSON and map that into a "generic object".

there a way to avoid this? I don't know if I have been clear. Also,
forgive me if I'm making assumptions that are not, I'm new to most of
this technologies, so I'm still trying to get some grip to them. :slight_smile:

In general, I'd guess the serializing/deser. might not be your bottleneck, but more so network bandwidth (upstream) and/or memory
management on Android for your sampling.

Here is a tip (or call it wild guess): concentrate on how to minimize
the transferred data volume. For that, for sampling data, approaches like: do not encode sample absolute values, but diffs from previous value. This will yield smaller, more repeating sequences of ints.

If you are able to make that sequences of ints into range 0-127 (probably shifted), you can convert that int sequence into an US-ASCII7
string. This will be much less volume than any JSON or adhoc serialization.

2 more notes:
We might add "WebSocket frame-based compression" to Autobahn in the future.
We might add binary WAMP to Autobahn.
I can't promise if, or when that happens, but those are real plans.

···

Thank you very much for your time!

Best regards,
Michel Cânovas

    Am 09.04.2012 19:27, schrieb Michel Cânovas:

        Hello again!

        I know there is a lot to do regarding this platform, and a lot of
        requests to handle, but I would like to have some feedback
        concerning my
        post. Mainly know if I have been clear exposing the problem,
        or/and, if
        there is actually anyone looking at this, if the problem can be
        solved.

        Thank you very much for the attention,

        Best regards
        Michel Cânovas

        No dia 5 de Abril de 2012 12:56, Michel Cânovas
        <michelm...@gmail.com <mailto:michelm...@gmail.com>
        <mailto:michelm...@gmail.__com
        <mailto:michelm...@gmail.com>>> escreveu:

            Hi!

            I'm using Autobahn ws in an app that does real time signal
        acquisition
            and processing. The client side is an Android device that
        gathers the
            signal at a sampling rate of 1000Hz and transmits 100
        samples every
            0.1s. On the server side, it is supposed to receive the
        signal and
            retrieve a filtered version back to the Android.

            Everything works fine, except once in a while, when the server
            receives a message which it cannot decode. All the sent
        messages have
            the same valid structure, but every once in a while the
        server finds
            an error which I can't ignore since it would mean data loss.

            I don't know if it is related with the message size, or
        rate. I'd like
            to understand what happens if I try to send a message through an
            Autobahn ws whilst it is sending a previous one. Could this
        be the
            case?

            I'll just leave one server side log below, where it's
        printed every
            received message and the error, if there is one.

            Thank you in advance,

            Michel Cânovas

            Note: the first two results are the last ones to be as they
        should.
              Separator: -----.------
              The correct message has the following structure:
            CMDqueue.put({'Frames': [...]})

            Log result:

            CMDqueue.put({'Frames':[-128, 125, 122, 119, 118, 119, 121,
        125, -128,
            -126, -123, -121, -120, -119, -120, -121, -123, -125, -127,

            -128, 126, 124, 121, 121, 122, 124, 126, 127, -128, -125,
        -124, -124,
            -122, -120, -119, -120, -122, -123, -125, -128, -128, -127,

            -127, 125, 122, 122, 123, 122, 121, 121, 123, 126, -127,
        -125, -124,
            -124, -126, -127, -128, 127, 126, 124, 121, 120, 121, 122, 1

            22, 121, 122, 125, -127, -124, -123, -125, -125, -126, -125,
        -126,
            127, 125, 123, 123, 122, 120, 118, 117, 119, 121, 124, 127, -12

            7, -128, 127, 127, -128, -127, -127, -128, 126, 123]})

            -----.------

            CMDqueue.put({'Frames':[121, 122, 122, 122, 122, 123, 124,
        125, 125,
            126, 127, -128, -127, -126, -126, -126, -127, -127, -128, 126

            , 126, 125, 122, 121, 121, 121, 120, 119, 119, 123, 126,
        127, -126,
            -126, -128, 127, 127, 127, -128, -127, -127, 127, 125, 125, 12

            5, 126, 127, -127, -125, -123, -121, -119, -117, -115, -113,
        -110,
            -108, -107, -108, -112, -115, -115, -115, -116, -117, -118, -11

            9, -120, -121, -122, -123, -123, -123, -123, -123, -124,
        -125, -127,
            126, 124, 121, 116, 111, 105, 102, 100, 100, 102, 105, 108, 1

            10, 113, 115, 117, 117, 116, 117, 119, 121, 120]})

            -----.------

            M​:left_right_arrow: O\:slight_smile: QK​:heart:◄NM​:left_right_arrow:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow: O\:slight_smile: QM​:heart:◄NM​:left_right_arrow: O\:slight_smile: QN​:heart:◄NM​:left_right_arrow::heart:O\:slight_smile:
        QH​:heart:◄NM​:left_right_arrow::spades:O
            \▲♥UP☼ QH♥◄RN→

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            M▲ O\:slight_smile: RE​:heart:◄NM​:left_right_arrow::slight_smile:O\:slight_smile: QO​:heart:◄NM​:left_right_arrow:O\▲:heart:TP☼ QI​:heart:◄RN←:left_right_arrow:CM​:left_right_arrow::clubs:O\▲:heart:PP☼
        QH♥◄RN←↔CM↔O
            \:slight_smile: QD​:heart:◄RN↑

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            :slight_smile:◄▼▲► :slight_smile:◄▼▲► :slight_smile::slight_smile:◄▼:slight_smile:▼:diamonds:▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄▼:slight_smile:▼ ▲► :slight_smile:◄:heart::slight_smile:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ∟↔◄↓↔♀↕←↔♀◄▼ ∟♥←♀↕←↔♀◄▼♣ ∟♥↑♀

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            § ◄:spades:▲R#\:diamonds:↑ ]BO>:heart:TD]:slight_smile:EXT∟UYE​:heart:TGU​:slight_smile:EXT∟TYE​:heart:__TGQ​:slight_smile:EXT∟PYE​:heart:TGP​:slight_smile:EXT∟PY

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            :slight_smile:▲§:slight_smile:►:left_right_arrow::arrow_up_down:←∟♀◄▼↓♀ ∟:slight_smile:←♀

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

              ∟♀◄:heart::left_right_arrow:↨:left_right_arrow::arrow_up_down::left_right_arrow:◄▲♀◄

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            →♀◄▼:left_right_arrow::arrow_up_down: ▲♀

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

              File "<string>", line 1

                →♀◄▼:left_right_arrow::arrow_up_down:

                ^

            SyntaxError: invalid syntax

            -----.------

            ◄♠♂R#\◄↑ ]WO>▼B@I♫AGQ

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            :heart:▼♀◄ ▲§:left_right_arrow:◄:left_right_arrow::arrow_up_down::left_right_arrow:♀◄:heart::spades: :heart:→♀◄ ▲¶:left_right_arrow:◄:left_right_arrow::arrow_up_down::diamonds::left_right_arrow:♀◄:heart::spades: ∟ ▲▬:left_right_arrow:◄:slight_smile:◄:heart::slight_smile: ∟ ▲◄:left_right_arrow:◄:slight_smile:◄:heart::slight_smile:
            ▲:arrow_up_down::left_right_arrow:◄:slight_smile:◄:heart::diamonds: ∟ ▲↨:left_right_arrow:◄:slight_smile:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ◄:heart:↓:left_right_arrow::arrow_up_down::diamonds:▲:diamonds:▲§:left_right_arrow::heart::diamonds:↓♀ :heart: ◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :diamonds: ◄▼:diamonds:▲:slight_smile:▲§:slight_smile: :heart:♀ ◄▼:diamonds::left_right_arrow:
             ▲§:slight_smile: :heart:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ◄ :spades:→:left_right_arrow:◄:spades::left_right_arrow::diamonds::left_right_arrow:↨:left_right_arrow: :slight_smile:←♀ :diamonds::spades:▲:left_right_arrow:◄:spades::left_right_arrow::slight_smile::left_right_arrow:↨:left_right_arrow: :diamonds:←♀ ☼ ◄ :spades::left_right_arrow:◄:spades::left_right_arrow::left_right_arrow:↨:left_right_arrow: ←♀ :slight_smile::slight_smile: ◄ ▼:left_right_arrow:◄

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ∟▲¶:slight_smile:◄:left_right_arrow::arrow_up_down:←:left_right_arrow:♀ ▲§:slight_smile:◄:left_right_arrow::arrow_up_down:→:left_right_arrow:♀◄▼:diamonds: ∟:heart:↑♀

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ◄▼▲ ▲▬:left_right_arrow::heart::clubs:→♀ ◄:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:

            →♀∟:heart::diamonds:←:left_right_arrow::arrow_up_down:←:left_right_arrow::heart:→♀∟:heart::diamonds:▲:left_right_arrow::arrow_up_down:←:left_right_arrow::heart::slight_smile:→♀∟:heart::diamonds:∟:left_right_arrow:__​:arrow_up_down:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            7aqw
        ``t%yle&~ti7}rp;lmt%tle:}rs;__lmt%yle:}rv;lmt%~le:}rt;lmt&__ule:}
            q};lmt&ule:}ru;lmt%~le:}rp;__lmt%tle&~vi7

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

              File "<string>", line 1

                7aqw
        ``t%yle&~ti7}rp;lmt%tle:}rs;__lmt%yle:}rv;lmt%~le:}rt;lmt&__ule:}
            q};lmt&ule:}ru;lmt%~le:}rp;__lmt%tle&~vi7

                   ^

            SyntaxError: invalid syntax

            -----.------

            %~le&~ri7}rv;lqw"``t%yle&~vi7}__rs;lqw#``t%~le&}yi7}q|;lqt
        ``t&yle&}ui7}
            qs;lqt!``t&{le&}yi7}rt;lqw&``__t%~le&~ri7}rw;lqw

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

              File "<string>", line 1

          %~le&~ri7}rv;lqw"``t%yle&~vi7}__rs;lqw#``t%~le&}yi7}q|;lqt
        ``t&yle&}
            ui7}qs;lqt!``t&{le&}yi7}rt;__lqw&``t%~le&~ri7}rw;lqw

                ^

            SyntaxError: invalid syntax

            -----.------

              ◄▼:diamonds:▲ ▲§:slight_smile: :heart: ◄▼:diamonds:▲:spades:▲§:left_right_arrow::heart:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            :heart::slight_smile::left_right_arrow:♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:◄:clubs:▼♀◄:heart::diamonds: :heart::slight_smile:¶♀:arrow_up_down::slight_smile::left_right_arrow:↑▲:bangbang::left_right_arrow:

            ▼♀◄ :heart: :heart::slight_smile:▼♀:arrow_up_down::slight_smile:▲▬▲:bangbang::slight_smile::diamonds: ▼:slight_smile:▲¶▲

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

              :spades::slight_smile:◄:heart::spades:§:left_right_arrow::arrow_up_down::spades:∟:spades:▲↨∟ :diamonds:←▼:diamonds:▲↨∟:heart::spades:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ♀◄:heart::arrow_up_down::left_right_arrow::arrow_up_down:▲§◄ ♂↓ :heart:♀♀◄:heart::diamonds:↓:left_right_arrow::arrow_up_down:▲§◄:heart::heart:↓ ♀◄:heart:§:left_right_arrow::arrow_up_down::diamonds::arrow_up_down:▲§◄:heart::clubs:↓ ∟:heart:↨:left_right_arrow::arrow_up_down:↑◄:heart:↓
        ∟:heart:§:left_right_arrow::arrow_up_down:↑◄:heart::diamonds:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            §♀◄ :left_right_arrow:↑:left_right_arrow:◄:left_right_arrow:◄ :left_right_arrow:♀◄ ←♀◄ :left_right_arrow:↨:left_right_arrow:◄:left_right_arrow::arrow_up_down::slight_smile::left_right_arrow:♀◄:heart::diamonds: ∟ ▲

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

            ▼▲↨▲▬:slight_smile:◄ :heart: ▼▲§▲▬:slight_smile:◄ :heart: ▼▲▬▲▬:slight_smile:◄ :slight_smile: :heart::diamonds:→♀:arrow_up_down:

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

            -----.------

                    ▲:bangbang::slight_smile:↑:slight_smile:◄▼☼ ∟

                    ↔↨☺↑↔◄↓¶♀◄▼ ∟ §♀

            Traceback (most recent call last):

              File "pywio.py", line 10, in evaluate

                res=eval(req)

            TypeError: expected string without null bytes

0 Likes

#10

server side that I just found out. Now I'm integrating Autobahn ws into
the server side, let's see how it works...

Cool! If you run into issues/questions, don't hesitate to ask ..

Thank you for your quick replies, they have been a great help! Could you
just answer my previous question about WAMP? I'm considering that
implementation on a future version of my app...

Just done.

Thank you for your time and patience!

No problem.

Curious: could you describe your actual project a little? What sampling
data are you gathering on Android, what processing is done on server?

Cheers,
Tobias

···

Regards,
Michel C�novas

No dia 10 de Abril de 2012 14:53, Tobias Oberstein
<tobias.o...@gmail.com <mailto:tobias.o...@gmail.com>> escreveu:

            You are using Autobahn Android as client, connected to Autobahn
            Python as server?

        I'm using Autobahn Android as client and a custom Python server.

    Sorry (overread that): you are NOT using Autobahn as server, but
    something else, but also Python based?

    Why?

    But anyway: why are you asking here?

0 Likes

#11

Curious: could you describe your actual project a little? What sampling

data are you gathering on Android, what processing is done on server?

About “my project”, I’m doing experiments to see if I can robustly communicate with a bluetooth device that gathers signals (like ECG) and graphically display them in an Android device in real time, with a middle step being some filtering in a remote server.

Now, Autobahn is integrated in the Server but, I’m having a little trouble since I have a thread that receives the messages from the socket and starts a new one that does the signal filtering. After this processing is done I want to send the message back to the Android device from this thread, but I can’t. I have to send the filtered signal back to the first thread in order to be able to use the ws. How can I change this? This process is causing random lag on sent messages (my guess ->) due to other tasks running on this thread, so sending the signal as soon as it is filtered (from the filtering thread) would avoid this.

The server implementation is based on the echo server imp. There, the echo is sent from inside the onMessage(), obviously this does not work for me because I want to use another thread. How would you recommend me to do that? Is it possible?

Thank you!

Regards,

Michel

No dia 11 de Abril de 2012 20:29, Tobias Oberstein tobias.o...@gmail.com escreveu:

···

server side that I just found out. Now I’m integrating Autobahn ws into

the server side, let’s see how it works…

Cool! If you run into issues/questions, don’t hesitate to ask …

Thank you for your quick replies, they have been a great help! Could you

just answer my previous question about WAMP? I’m considering that

implementation on a future version of my app…

Just done.

Thank you for your time and patience!

No problem.

Curious: could you describe your actual project a little? What sampling

data are you gathering on Android, what processing is done on server?

Cheers,

Tobias

Regards,

Michel Cânovas

No dia 10 de Abril de 2012 14:53, Tobias Oberstein

<tobias.o...@gmail.com mailto:tobias.oberstein@gmail.com> escreveu:

        You are using Autobahn Android as client, connected to Autobahn

        Python as server?



    I'm using Autobahn Android as client and a custom Python server.





Sorry (overread that): you are NOT using Autobahn as server, but

something else, but also Python based?



Why?



But anyway: why are you asking here?
0 Likes

#12

Now, Autobahn is integrated in the Server but, I'm having a little
trouble since I have a thread that receives the messages from the socket
and starts a new one that does the signal filtering. After this
processing is done I want to send the message back to the Android device
from this thread, but I can't. I have to send the filtered signal back
to the first thread in order to be able to use the ws. How can I change
this? This process is causing random lag on sent messages (my guess ->)
due to other tasks running on this thread, so sending the signal as soon
as it is filtered (from the filtering thread) would avoid this.

you need to do it asynch way:

onMessage():

   d = deferToThread(<your filtering stuff automatically spawned in thread from Twisted thread pool>)

   d.addCallback(lambda res: self.sendMessage(res))
   d.addErrback(..

read a little about Twisted and threads ..

if you want to do communicate with Twisted main loop from threads that
you spawned in other ways, and that run independently from WS requests/connections, you want to use

callFromThread

hope this gets you started ..

0 Likes

#13

you need to do it asynch way:

onMessage():

d = deferToThread(<your filtering stuff automatically spawned in thread
from Twisted thread pool>)

d.addCallback(lambda res: self.sendMessage(res))
d.addErrback(..

So this means that I always have to start the new (filtering) thread from
the onMessage and retrieve the result?

···

read a little about Twisted and threads ..

if you want to do communicate with Twisted main loop from threads that
you spawned in other ways, and that run independently from WS
requests/connections, you want to use

callFromThread

hope this gets you started ..

0 Likes

#14

    you need to do it asynch way:

    onMessage():

      d = deferToThread(<your filtering stuff automatically spawned in
    thread from Twisted thread pool>)

      d.addCallback(lambda res: self.sendMessage(res))
      d.addErrback(..

So this means that I always have to start the new (filtering) thread
from the onMessage and retrieve the result?

No. See below and: you can have a long running filtering thread, push work task in onMessage into a queue where the filtering thread listens, and when the filtering is done, callFromThread to deliver the result.

You need a thread safe queue and queue objects that contain the filtering task to be done plus a reference to the protocol instance where the result is to be delivered-

···

Am 24.04.2012 11:57, schrieb Michel C�novas:

    read a little about Twisted and threads ..

    if you want to do communicate with Twisted main loop from threads that
    you spawned in other ways, and that run independently from WS
    requests/connections, you want to use

    callFromThread

    hope this gets you started ..

0 Likes