Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named response_frames #1

Open
K4KDR opened this issue Dec 6, 2018 · 7 comments
Open

No module named response_frames #1

K4KDR opened this issue Dec 6, 2018 · 7 comments

Comments

@K4KDR
Copy link

K4KDR commented Dec 6, 2018

System is Ubuntu 16.04, 64-bit.

python --version
Python 2.7.12

python -m pip show construct
Name: construct
Version: 2.9.45

When attempting to use this block in GNU Radio, -or- when simply running it from the command line, I get the following:

  File "payload_decoder.py", line 21, in <module>
    import response_frames
ImportError: No module named response_frames

Is my environment lacking a requirement to use this code?

Many thanks.

-Scott, K4KDR

@begreeen
Copy link
Contributor

begreeen commented Dec 7, 2018

Probably you didn't pull the submodule PWSat2OBC which is used in this code - clone should look like that:

$ cd FramePayloadDecoder
$ git submodule init
$ git submodule update

@K4KDR
Copy link
Author

K4KDR commented Dec 7, 2018

Thank you for the reply!

Yes, those were the exact steps followed and appeared to run to completion. Checking my command history, I see:

 1951  git clone https://github.com/PW-Sat2/FramePayloadDecoder
 1952  cd FramePayloadDecoder/
 1953  git submodule init
 1954  git submodule update

@daniestevez
Copy link

Hi Scott, this is odd.

Could you please check that you have indeed a response_frames.py file inside your `FramePayloadDecoder/PWSat2OBC/integration_tests/' folder?

Also, please paste the complete traceback in case there are any other important clues.

@K4KDR
Copy link
Author

K4KDR commented Dec 7, 2018

I see a FOLDER in that path named "response_frames"; here is that listing:

k4kdr@:~/FramePayloadDecoder/PWSat2OBC/integration_tests$ ls -l
total 108
-rw-rw-r-- 1 k4kdr k4kdr   239 Dec  6 18:30 build_config.py
-rw-rw-r-- 1 k4kdr k4kdr  1463 Dec  6 18:30 CMakeLists.txt
-rw-rw-r-- 1 k4kdr k4kdr   416 Dec  6 18:30 config.py.template
-rw-rw-r-- 1 k4kdr k4kdr  2689 Dec  6 18:30 crc.py
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:31 devices
drwxrwxr-x 3 k4kdr k4kdr  4096 Dec  6 18:30 emulator
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:30 experiment_file
-rw-rw-r-- 1 k4kdr k4kdr   419 Dec  6 18:30 experiment_type.py
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:30 extensions
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:31 i2cMock
drwxrwxr-x 3 k4kdr k4kdr  4096 Dec  6 18:30 ipython_profile
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:30 obc
-rw-rw-r-- 1 k4kdr k4kdr  1005 Dec  6 18:30 parsing.py
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:30 persistent_state
-rw-rw-r-- 1 k4kdr k4kdr   752 Dec  6 18:30 pins.py
-rw-rw-r-- 1 k4kdr k4kdr   194 Dec  6 18:30 requirements.txt
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:31 response_frames
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:30 scripts
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:30 system
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:30 telecommand
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:30 tests
drwxrwxr-x 2 k4kdr k4kdr  4096 Dec  6 18:30 tools
-rw-rw-r-- 1 k4kdr k4kdr  5541 Dec  6 18:30 utils.py
-rw-rw-r-- 1 k4kdr k4kdr 10359 Dec  6 18:31 utils.pyc
k4kdr@:~/FramePayloadDecoder/PWSat2OBC/integration_tests$ 

... and here is the contents of that folder:

k4kdr@:~/FramePayloadDecoder/PWSat2OBC/integration_tests/response_frames$ ls -l
total 124
-rw-rw-r-- 1 k4kdr k4kdr  519 Dec  6 18:30 adcs.py
-rw-rw-r-- 1 k4kdr k4kdr  324 Dec  6 18:30 beacon_factory.py
-rw-rw-r-- 1 k4kdr k4kdr 1086 Dec  6 18:31 beacon_factory.pyc
-rw-rw-r-- 1 k4kdr k4kdr 4205 Dec  6 18:30 common.py
-rw-rw-r-- 1 k4kdr k4kdr  199 Dec  6 18:30 comm.py
-rw-rw-r-- 1 k4kdr k4kdr  412 Dec  6 18:30 compile_info.py
-rw-rw-r-- 1 k4kdr k4kdr  315 Dec  6 18:30 disable_overheat_submode.py
-rw-rw-r-- 1 k4kdr k4kdr 1426 Dec  6 18:30 downlink_frame_factory.py
-rw-rw-r-- 1 k4kdr k4kdr  529 Dec  6 18:30 exception.py
-rw-rw-r-- 1 k4kdr k4kdr 1672 Dec  6 18:31 exception.pyc
-rw-rw-r-- 1 k4kdr k4kdr  662 Dec  6 18:30 fdir.py
-rw-rw-r-- 1 k4kdr k4kdr  870 Dec  6 18:30 file_system.py
-rw-rw-r-- 1 k4kdr k4kdr  362 Dec  6 18:30 frame_decoder.py
-rw-rw-r-- 1 k4kdr k4kdr 1244 Dec  6 18:31 frame_decoder.pyc
-rw-rw-r-- 1 k4kdr k4kdr 3152 Dec  6 18:30 __init__.py
-rw-rw-r-- 1 k4kdr k4kdr 6127 Dec  6 18:31 __init__.pyc
-rw-rw-r-- 1 k4kdr k4kdr   40 Dec  6 18:30 marker.py
-rw-rw-r-- 1 k4kdr k4kdr  438 Dec  6 18:30 memory.py
-rw-rw-r-- 1 k4kdr k4kdr  690 Dec  6 18:30 operation.py
-rw-rw-r-- 1 k4kdr k4kdr  736 Dec  6 18:30 period_message.py
-rw-rw-r-- 1 k4kdr k4kdr  238 Dec  6 18:30 persistent_state.py
-rw-rw-r-- 1 k4kdr k4kdr  184 Dec  6 18:30 pong.py
-rw-rw-r-- 1 k4kdr k4kdr 1124 Dec  6 18:30 program_upload.py
-rw-rw-r-- 1 k4kdr k4kdr  248 Dec  6 18:30 sail_experiment.py
-rw-rw-r-- 1 k4kdr k4kdr  291 Dec  6 18:30 set_bitrate.py
-rw-rw-r-- 1 k4kdr k4kdr  313 Dec  6 18:30 stop_antenna_deployment.py
-rw-rw-r-- 1 k4kdr k4kdr  307 Dec  6 18:30 stop_sail_deployment.py
-rw-rw-r-- 1 k4kdr k4kdr  376 Dec  6 18:30 suns.py
-rw-rw-r-- 1 k4kdr k4kdr 1064 Dec  6 18:30 time.py
k4kdr@:~/FramePayloadDecoder/PWSat2OBC/integration_tests/response_frames$ 

... and as for the traceback, I do not know what has changed since yesterday but I am now getting more errors than the single item initially reported:

Executing: /usr/bin/python -u /home/k4kdr/gr-satellites/apps/pwsat2.py

Traceback (most recent call last):
  File "/home/k4kdr/gr-satellites/apps/pwsat2.py", line 242, in <module>
    main()
  File "/home/k4kdr/gr-satellites/apps/pwsat2.py", line 236, in main
    tb = top_block_cls(bfo=options.bfo, callsign=options.callsign, latitude=options.latitude, longitude=options.longitude, port=options.port, recstart=options.recstart, ip=options.ip)
  File "/home/k4kdr/gr-satellites/apps/pwsat2.py", line 56, in __init__
    self.satellites_pwsat2_telemetry_parser_0 = satellites.pwsat2_telemetry_parser("/home/k4kdr/FramePayloadDecoder")
  File "/usr/local/lib/python2.7/dist-packages/satellites/pwsat2_telemetry_parser.py", line 44, in __init__
    self.pwsat2_decoder = __import__('payload_decoder')
  File "/home/k4kdr/FramePayloadDecoder/payload_decoder.py", line 21, in <module>
    import response_frames
  File "/home/k4kdr/FramePayloadDecoder/PWSat2OBC/integration_tests/response_frames/__init__.py", line 2, in <module>
    from beacon_factory import BeaconFrameFactory
  File "/home/k4kdr/FramePayloadDecoder/PWSat2OBC/integration_tests/response_frames/beacon_factory.py", line 1, in <module>
    from devices.comm_beacon import BeaconFrame
  File "/home/k4kdr/FramePayloadDecoder/PWSat2OBC/integration_tests/devices/__init__.py", line 1, in <module>
    from eps import EPS
  File "/home/k4kdr/FramePayloadDecoder/PWSat2OBC/integration_tests/devices/eps.py", line 7, in <module>
    import i2cMock
  File "/home/k4kdr/FramePayloadDecoder/PWSat2OBC/integration_tests/i2cMock/__init__.py", line 1, in <module>
    from i2cMock import *
  File "/home/k4kdr/FramePayloadDecoder/PWSat2OBC/integration_tests/i2cMock/i2cMock.py", line 11, in <module>
    from utils import hex_data
  File "/home/k4kdr/FramePayloadDecoder/PWSat2OBC/integration_tests/utils.py", line 5, in <module>
    from bitarray import bitarray
ImportError: No module named bitarray

>>> Done (return code 1)

@daniestevez
Copy link

Ok. response_frames is indeed a folder, not a .py file. My confusion.

Now, you need to install bitarray. This can (perhaps) be installed with your distribution's package manager or with pip2. I'll add this to the instruction in my blog.

@K4KDR
Copy link
Author

K4KDR commented Dec 7, 2018

Seems that "typing" is also needed. I have installed both and we seem to be good. Thanks so much!

pdu_length = 246
contents = 
0000: a0 ae a6 82 a8 64 e0 a0 ae a6 82 a8 64 61 03 f0 
0010: cd 25 01 00 00 07 67 00 fd bf ad 82 6e 07 00 00 
0020: 00 00 f3 37 6f 38 00 00 00 00 00 00 00 00 00 0a 
0030: 00 00 00 00 0a ba 42 01 c0 1a 28 00 d3 ba 0d 00 
0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 24 80 
0050: 80 f7 7f f2 3f 06 80 11 68 07 28 36 a9 6e 53 dd 
0060: 4b 99 bc 88 81 01 25 3e 38 48 49 c1 cf 5d 4d 3c 
0070: b7 ce c4 32 c3 28 07 88 49 8a 33 94 1c d1 6a 4c 
0080: 1c 1d 32 81 10 89 e2 ba 65 c1 88 03 74 1c 0c e0 
0090: 2f 13 00 69 be 5e 1e b8 03 00 57 5b 28 f3 01 00 
00a0: 5d 77 ed 22 da 67 cb 83 26 80 9e ec 17 29 00 80 
00b0: d7 5c c7 08 00 00 00 00 00 00 00 00 00 00 00 00 
00c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00f0: 00 00 00 00 00 00 
***********************************
<class 'devices.comm_beacon.BeaconFrame'>
{'01: Startup': {'0000: Boot Counter': 293,
                 '0032: Boot Index': {'converted': 7, 'raw': 7, 'unit': None},
                 '0040: Boot Reason': {'converted': 103,
                                       'raw': 103,
                                       'unit': None}},
 '02: Program State': {'0056: Program CRC': {'converted': 49149,
                                             'raw': 49149,
                                             'unit': None}},
 '03: Time Telemetry': {'0072: Mission time': {'converted': datetime.timedelta(1, 38282, 925000),
                                               'raw': 124682925,
                                               'unit': None},

@daniestevez
Copy link

Also added the requirement of typing in my blog. Thanks for beta-testing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants