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

Running Api (Server) #2

Open
DerKleinePunk opened this issue Sep 5, 2021 · 4 comments
Open

Running Api (Server) #2

DerKleinePunk opened this issue Sep 5, 2021 · 4 comments

Comments

@DerKleinePunk
Copy link

Can not Start the Backend Server

*@*:~/develop/herbiOS/api$ npm install
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated @types/[email protected]: This is a stub types definition. socket.io provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.

added 401 packages, and audited 402 packages in 3m

29 packages are looking for funding
  run `npm fund` for details

6 vulnerabilities (2 moderate, 4 high)
*@*:~/develop/herbiOS/api$ npm start

> [email protected] start
> nodemon -e ts --watch 'src/**/*.ts' --exec 'ts-node' src/app.ts

sh: 1: nodemon: not found
@DerKleinePunk
Copy link
Author

npm install -g nodemon
npm install -g ts-node

server listening on http://0.0.0.0:5555
Read READYheater -do stop
[Error: ENOENT: no such file or directory, open '/tmp/shairport-sync-metadata'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/tmp/shairport-sync-metadata'
}
[nodemon] app crashed - waiting for file changes before starting...

After install That server is startet but crashed.

@JohannesHoffmann
Copy link
Owner

Thank's for your issue. I could reproduce the bug and fixed it with the latest changes. Hope it works for you?

@DerKleinePunk
Copy link
Author

DerKleinePunk commented Sep 7, 2021

Next Crash

/home/punky/develop/herbiOS/api/src/lights/LightsService.ts:21
        for (const lightConfiguration of this.config.get().lights) {
                                                          ^
TypeError: this.config.get.lights is not iterable
    at new LightsService (/home/punky/develop/herbiOS/api/src/lights/LightsService.ts:21:59)
    at Function.getInstance (/home/punky/develop/herbiOS/api/src/lights/LightsService.ts:12:35)
    at LightsSocket._socket (/home/punky/develop/herbiOS/api/src/lights/LightsSocket.ts:31:45)
    at Namespace.<anonymous> (/home/punky/develop/herbiOS/api/src/api/websocket/NamespaceSocket.ts:59:18)
    at Namespace.emit (events.js:400:28)
    at Namespace.emit (domain.js:470:12)
    at Namespace.emitReserved (/home/punky/develop/herbiOS/api/node_modules/socket.io/dist/typed-events.js:56:22)
    at /home/punky/develop/herbiOS/api/node_modules/socket.io/dist/namespace.js:141:26
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

Question:
Working with Sensorer on /dev/ttyACM0 with baudrate 500000
How to Config the Device and Baudrate. Not all Raspi hast ttyACM0 when Trun Off the Bluethooth ACM0 dit not Exits.
The Baudrate ist not a Standard in C++ is difficoult to make this. On PC ACM0 Does not Exits for Testing Software.

@JohannesHoffmann
Copy link
Owner

This is caused because there is no update path at the moment. The server generates configuration files in the data directory. Delete all files and start the server again. It should generate new config files with the new structure for you.

You can modify the configurations for your needs. Add lights in the data/lights.json file for example.

The data/config.json file stores all configuration for the main system. There you can change the path for the serial connection of the sensorer as well the Baudrated.

I will add this to the readme.

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

2 participants