Cannot get any data from serial
Closed this issue · 1 comments
koktaildotcom commented
Thanks for sharing this code. I've tried to work it out to build an simple script that can feed my home automation project.
If i use cu -l /dev/ttyUSB0 -s 115200 --parity=none -E q
i can read successful the data.
After some hours i can get some logging working.
I only have an debug log: {"message":"Connection.connect: Entering","level":"debug"}
.
Can you point to me where i should look?
const p1Meter = new smartMeter({
port: '/dev/ttyUSB0',
bps: 115200,
bits: 8,
parity: 'none',
})
p1Meter.on('connected', () => {
console.log('connected')
})
p1Meter.on('update', line => {
console.log(line)
})
p1Meter.on('disconnected', () => {
console.log('disconnected')
})
p1Meter.connect()
koktaildotcom commented
I've made a type bps
should be baudrate
. Thanks for this library!