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

Raspberry Issues #14

Open
justanotherstark opened this issue Nov 26, 2019 · 12 comments
Open

Raspberry Issues #14

justanotherstark opened this issue Nov 26, 2019 · 12 comments

Comments

@justanotherstark
Copy link

Hi, I am trying to make this project work so that I can control my R2-Q5 from a Raspberry 4.

I solved a problem in yarn install with the dependency that wasn't for Linux (xpc-connection) and made it to rebuild by commenting a line in scanner.ts that had a problem with declarations (import { IToyDiscovered } from './scanner';).
After fighting with the bluetooth-hci module I managed to have everything ready but it still doesn't work.

Can someone help me?

This is the error:
sudo yarn server
yarn run v1.19.2
$ ts-node src/server

/usr/lib/node_modules/ts-node/src/index.ts:293
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
src/server.ts:1:40 - error TS2307: Cannot find module 'spherov2.js'.

1 import { Scanner, Stance, Utils } from 'spherov2.js';
~~~~~~~~~~~~~
src/server.ts:2:28 - error TS2307: Cannot find module 'spherov2.js'.

2 import { R2D2, R2Q5 } from 'spherov2.js';
~~~~~~~~~~~~~
src/server.ts:3:30 - error TS2307: Cannot find module 'spherov2.js'.

3 import { sounds_array } from 'spherov2.js';
~~~~~~~~~~~~~

at createTSError (/usr/lib/node_modules/ts-node/src/index.ts:293:12)
at reportTSError (/usr/lib/node_modules/ts-node/src/index.ts:297:19)
at getOutput (/usr/lib/node_modules/ts-node/src/index.ts:399:34)
at Object.compile (/usr/lib/node_modules/ts-node/src/index.ts:457:32)
at Module.m._compile (/usr/lib/node_modules/ts-node/src/index.ts:530:43)
at Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Object.require.extensions.<computed> [as .ts] (/usr/lib/node_modules/ts-node/src/index.ts:533:12)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@superfashi
Copy link
Contributor

Try building using my forked version https://github.com/hanbang-wang/sphero-project. You can reference build.sh (but don't directly execute it since I hard coded build directory).

@justanotherstark
Copy link
Author

Nope, the same issue.

At first yarn server says that it hasn't found bluetooth-hci and when I installed it the same error appears

@superfashi
Copy link
Contributor

Did you follow every step and make sure you yarn install and yarn rebuild?

@justanotherstark
Copy link
Author

justanotherstark commented Nov 26, 2019

absolutely, also checked build.sh for reference. I hoped the apt install would have installed all that was needed for the Bluetooth part

@callison-burch
Copy link
Collaborator

callison-burch commented Nov 26, 2019 via email

@justanotherstark
Copy link
Author

I will try to install it on my laptop with windows, maybe I will have more luck

@superfashi
Copy link
Contributor

Windows doesn't work for sure. Try installing docker and directly use my pre-wrote docker file. It should work with that on your RPI.

@justanotherstark
Copy link
Author

Ok, with Docker the server works (YAY).
I have a question, am I supposed to do the python part from inside docker?
I am new to this program and I don't know how to do stuff with it.

@superfashi
Copy link
Contributor

After the docker starts running, you can just run python on your local machine and it should automatically connect to docker.

@justanotherstark
Copy link
Author

Ok, running python and "from client import DroidClient" inside one of the folder that I downloaded shows this:

Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from client import DroidClient
Traceback (most recent call last):
File "/home/pi/Q5/sphero-project/r2d2/lib/python3.7/site-packages/numpy/core/init.py", line 17, in
from . import multiarray
File "/home/pi/Q5/sphero-project/r2d2/lib/python3.7/site-packages/numpy/core/multiarray.py", line 14, in
from . import overrides
File "/home/pi/Q5/sphero-project/r2d2/lib/python3.7/site-packages/numpy/core/overrides.py", line 7, in
from numpy.core._multiarray_umath import (
ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/home/pi/Q5/sphero-project/src/client.py", line 3, in
import numpy as np
File "/home/pi/Q5/sphero-project/r2d2/lib/python3.7/site-packages/numpy/init.py", line 142, in
from . import core
File "/home/pi/Q5/sphero-project/r2d2/lib/python3.7/site-packages/numpy/core/init.py", line 47, in
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.

  • Try uninstalling and reinstalling numpy.

  • If you have already done that, then:

    1. Check that you expected to use Python3.7 from "/home/pi/Q5/sphero-project/r2d2/bin/python",
      and that you have no directories in your PATH or PYTHONPATH that can
      interfere with the Python and numpy version "1.17.4" you're trying to use.
    2. If (1) looks fine, you can open a new issue at
      https://github.com/numpy/numpy/issues. Please include details on:
      • how you installed Python
      • how you installed numpy
      • your operating system
      • whether or not you have multiple versions of Python installed
      • if you built from source, your compiler versions and ideally a build log
  • If you're working with a numpy git repository, try git clean -xdf
    (removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory

Running it any other place (/home/pi) it won't find the module.

I think I am missing something here, Am I suppose to git clone at all using Docker?

@superfashi
Copy link
Contributor

This is a numpy issue.

@justanotherstark
Copy link
Author

Ok, I searched on google and after a while, I tried these commands and now everything works.

sudo apt install libffi-dev
sudo apt-get install libatlas-base-dev

Thanks for the assistance from me and my little buddy Q5

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