I have a feathersjs server running which I can connect to successfully from a browser client (using webpack). Now I am trying to connect to same server from a nodejs app running on a Raspberry Pi3. I see no activity of the server when I do a find. I set up a hook logger for create on that service and it logs nothing. I can only assume that the client is never connecting. There is NO authentication hook on that service since I am just in dev so authentication module is not needed.
I can ping the server from the RPI and if I put the server ip/port into a browser on the RPI I get my "i'm a feathers server use a client" page so network connection and setup of IP on server is fine.
Any help on how to track down what is happening. Without any connection log (on the client) I can't tell what is happening. All I get is the timeout error from the .catch.
Below is my client code, the client code from the working browser client.
working browser client setup
import feathers from 'feathers'
import hooks from 'feathers-hooks'
import socketio from 'feathers-socketio'
import auth from 'feathers-authentication-client'
import io from 'socket.io-client'
// const socket = io('http://localhost:3030', {transports: ['websocket']})
// const socket = io('http://192.168.43.114:3030', {transports: ['websocket']})
const socket = io('http://192.168.0.51:3030', { transports: ['websocket'] })
const api = feathers()
.configure(hooks())
.configure(socketio(socket))
// .configure(auth({ storage: window.localStorage }))
export default api
not working nodejs client setup
const feathers = require('feathers/client');
const socketio = require('feathers-socketio/client');
const hooks = require('feathers-hooks');
// const errors = require('feathers-errors'); // An object with all of the custom error types.
// const auth = require('feathers-authentication-client');
const io = require('socket.io-client/dist/socket.io');
const socket = io('http://192.168.0.51:3030', { transports: ['websocket'] })
const feathersClient = feathers()
.configure(hooks())
.configure(socketio(socket))
//.configure(auth())
module.exports = feathersClient;
the node app which is just doing a find on my service.
const api = require('./api')
const switches = api.service('switches')
switches.find({
paginate: false
})
.then((response) => {
console.log('loading all switch data', response.data)
})
.catch((err) => {
console.log('error loading switch data', err)
})
the error from the .catch
error loading switch data Error: Timeout of 5000ms exceeded calling switches::find
at Timeout._onTimeout (/opt/lighting-dev/node_modules/feathers-socket-commons/lib/client.js:87:25)
at ontimeout (timers.js:469:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:264:5)