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

Testing error on new device #33

Open
Lacitis36 opened this issue Feb 28, 2021 · 40 comments · Fixed by WebThingsIO/addon-list#1322
Open

Testing error on new device #33

Lacitis36 opened this issue Feb 28, 2021 · 40 comments · Fixed by WebThingsIO/addon-list#1322

Comments

@Lacitis36
Copy link

Lacitis36 commented Feb 28, 2021

Candle Manager installed correctly.
Candle Receiver installed correctly.
Up to there everything works OK.
Created a "temperature and more" device.

When installing the new device, the process stops at testing with an error message.
If I disable the "MySensors" add-on, there is no error but then the device is not recognized at the "things" / "add" phase.


2021-02-28 13:20:47.589 INFO   : Candle-manager-addon: /home/pi/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -R .eeprom /tmp/arduino-sketch-A573221F682C7F3D9043B705672177CD/Temperature_and_more.ino.elf /tmp/arduino-sketch-A573221F682C7F3D9043B705672177CD/Temperature_and_more.ino.hex
2021-02-28 13:20:47.591 INFO   : Candle-manager-addon: Using library MySensors at version 2.3.2 in folder: /home/pi/Arduino/libraries/MySensors 
2021-02-28 13:20:47.593 INFO   : Candle-manager-addon: Using library SPI at version 1.0 in folder: /home/pi/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/SPI 
2021-02-28 13:20:47.604 INFO   : Candle-manager-addon: Using library Grove_-_Barometer_Sensor_BME280 at version 1.0.2 in folder: /home/pi/Arduino/libraries/Grove_-_Barometer_Sensor_BME280 
2021-02-28 13:20:47.605 INFO   : Candle-manager-addon: Using library Wire at version 1.0 in folder: /home/pi/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/Wire 
2021-02-28 13:20:47.608 INFO   : Candle-manager-addon: Using library SoftwareSerial at version 1.0 in folder: /home/pi/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/SoftwareSerial 
2021-02-28 13:20:47.610 INFO   : Candle-manager-addon: /home/pi/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-size -A /tmp/arduino-sketch-A573221F682C7F3D9043B705672177CD/Temperature_and_more.ino.elf
2021-02-28 13:20:47.612 INFO   : Candle-manager-addon: Sketch uses 27050 bytes (88%) of program storage space. Maximum is 30720 bytes.
2021-02-28 13:20:47.614 INFO   : Candle-manager-addon: Global variables use 1188 bytes (58%) of dynamic memory, leaving 860 bytes for local variables. Maximum is 2048 bytes.
2021-02-28 13:20:47.615 INFO   : Candle-manager-addon: 
2021-02-28 13:20:47.618 INFO   : Candle-manager-addon: 
2021-02-28 13:20:47.620 INFO   : Candle-manager-addon: Command success
2021-02-28 13:20:47.624 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:47] "�[37mGET /compile/10 HTTP/1.1�[0m" 200 -
2021-02-28 13:20:47.630 INFO   : Candle-manager-addon: Port to test upload to:/dev/ttyUSB0
2021-02-28 13:20:47.633 INFO   : Candle-manager-addon: Doing a test upload of the Candle Cleaner
2021-02-28 13:20:47.636 INFO   : Candle-manager-addon: Initial bootloader value: :cpu=atmega328
2021-02-28 13:20:47.638 INFO   : Candle-manager-addon: Uploading
2021-02-28 13:20:47.641 INFO   : Candle-manager-addon: bootloader parameter = :cpu=atmega328
2021-02-28 13:20:47.643 INFO   : Candle-manager-addon: Code name: Candle_cleaner
2021-02-28 13:20:47.647 INFO   : Candle-manager-addon: path to upload from: /home/pi/.webthings/data/Candle-manager-addon/code/Candle_cleaner
2021-02-28 13:20:47.649 INFO   : Candle-manager-addon: Arduino CLI upload command = /home/pi/.webthings/addons/Candle-manager-addon/arduino-cli/linux-armv7/arduino-cli upload -p /dev/ttyUSB0 --fqbn arduino:avr:nano:cpu=atmega328 /home/pi/.webthings/data/Candle-manager-addon/code/Candle_cleaner
2021-02-28 13:20:47.652 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:47] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:48.071 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:48] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:48.449 ERROR  : mysensors-adapter: Error decoding message from gateway, bad data received: I just blinked my LED
2021-02-28 13:20:48.451 ERROR  : mysensors-adapter: Not a valid message: not enough values to unpack (expected 5, got 0)
2021-02-28 13:20:48.621 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:48] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:49.039 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:49] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:49.619 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:49] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:49.862 ERROR  : mysensors-adapter: Error decoding message from gateway, bad data received: Hello
2021-02-28 13:20:49.864 ERROR  : mysensors-adapter: Not a valid message: not enough values to unpack (expected 5, got 0)
2021-02-28 13:20:49.865 ERROR  : mysensors-adapter: Error decoding message from gateway, bad data received: Starting memory wipe.
2021-02-28 13:20:49.866 ERROR  : mysensors-adapter: Not a valid message: not enough values to unpack (expected 5, got 0)
2021-02-28 13:20:50.045 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:50] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:50.622 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:50] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:51.086 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:51] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:51.623 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:51] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:51.969 INFO   : Candle-manager-addon: Error during Upload: uploading error: uploading error: exit status 1
2021-02-28 13:20:51.972 INFO   : Candle-manager-addon: first test result:{'success': False, 'message': 'Upload failed', 'errors': ['Error during Upload: uploading error: uploading error: exit status 1']}
2021-02-28 13:20:51.973 INFO   : Candle-manager-addon: success:False
2021-02-28 13:20:51.975 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:51] "�[37mPOST /test_upload/10 HTTP/1.1�[0m" 200 -
2021-02-28 13:20:52.034 ERROR  : mysensors-adapter: Error decoding message from gateway, bad data received: �e
2021-02-28 13:20:52.056 ERROR  : mysensors-adapter: Not a valid message: not enough values to unpack (expected 5, got 0)
2021-02-28 13:20:52.057 ERROR  : mysensors-adapter: Error decoding message from gateway, bad data received: Starting memory wipe.
2021-02-28 13:20:52.059 ERROR  : mysensors-adapter: Not a valid message: not enough values to unpack (expected 5, got 0)
2021-02-28 13:20:52.060 ERROR  : mysensors-adapter: Error decoding message from gateway, bad data received: Hello
2021-02-28 13:20:52.062 ERROR  : mysensors-adapter: Not a valid message: not enough values to unpack (expected 5, got 0)
2021-02-28 13:20:52.063 ERROR  : mysensors-adapter: Error decoding message from gateway, bad data received: Starting memory wipe.
2021-02-28 13:20:52.064 ERROR  : mysensors-adapter: Not a valid message: not enough values to unpack (expected 5, got 0)
2021-02-28 13:20:52.066 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:52] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:52.625 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:52] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:53.062 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:53] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:53.627 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:53] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:54.061 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:54] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:54.632 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:54] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:55.066 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:55] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
@Lacitis36
Copy link
Author

With the "MySensors" add-on disabled during install, the sketch is uploaded correctly and the device works as a standalone with the screen showing correct information. But there's no way to get it recognized in "Things".
After many reboots and re-install and using twice brand new RF-NANOs, the "Things" phase recognized some kind of "generic" "Candle Manager" with no associated functions.

@createcandle
Copy link
Collaborator

Have you followed the steps online? https://www.candlesmarthome.com/candle-manager-tutorial

It seems MySensors is interfering. That usually happens if it's trying to find the Candle Receiver. Are you sure that's plugged in?

  1. If you don't have the candle Receiver yet, disable MySensors.
  2. create the candle receiver. Leave it in your usb port.
  3. enable mysensors. It will link with your Candle receiver, and won't interfere with other devices you plug in.
  4. plug in other devices you want to upload code to.

Don't leave secondary devices plugged in to power them after they are made. That may confuse MySensors, as it won't be sure which one to link with when it starts up.

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 1, 2021 via email

@createcandle
Copy link
Collaborator

createcandle commented Mar 1, 2021

You did it perfectly (and the permission issue has been fixed). And those error aren't really errors.

Didn't it work? If not, could you share the full log? Because this snippet doesn't contain any errors.

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 1, 2021 via email

@createcandle
Copy link
Collaborator

I'll try a fresh install here, see if I run into anything.

@createcandle
Copy link
Collaborator

createcandle commented Mar 1, 2021

I think I found something.

/home/pi/.webthings/addons/Candle-manager-addon/arduino-cli/linux-armv7/arduino-cli lib install "Grove_-_Barometer_Sensor_BME280"
Error resolving dependencies for Grove_-_Barometer_Sensor_BME280: looking for library: library Grove_-_Barometer_Sensor_BME280 not found

This library is required for the temperature and more sensor. The script to pre-download some libraries had _ in the title, which shouldn't be there. I've removed them.

Then the library loads ok:

/home/pi/.webthings/addons/Candle-manager-addon/arduino-cli/linux-armv7/arduino-cli lib install "Grove - Barometer Sensor BME280"
Grove - Barometer Sensor BME280 depends on Grove - Barometer Sensor BME280@1.0.2
Downloading Grove - Barometer Sensor BME280@1.0.2...
Grove - Barometer Sensor BME280@1.0.2 downloaded                                                                                                                                    
Installing Grove - Barometer Sensor BME280@1.0.2...
Installed Grove - Barometer Sensor BME280@1.0.2

I didn't try to upload code beforehand, so I'm not 100 sure that was the culprit. But I tried an upload to a RFNano of the Temperature and more device, and it worked. I'm creating a new release (1.2.0) that should soon be available.

// Hmm, wait, you mentioned the candle receiver already giving an error while uploading. That's very odd. It doesn't have any dependencies other than MySensors itself.

@createcandle
Copy link
Collaborator

createcandle commented Mar 1, 2021

I'm looking through your earlier logs a bit closer.

2021-02-28 13:20:47.649 INFO   : Candle-manager-addon: Arduino CLI upload command = /home/pi/.webthings/addons/Candle-manager-addon/arduino-cli/linux-armv7/arduino-cli upload -p /dev/ttyUSB0 --fqbn arduino:avr:nano:cpu=atmega328 /home/pi/.webthings/data/Candle-manager-addon/code/Candle_cleaner
2021-02-28 13:20:47.652 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:47] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:48.071 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:48] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:48.449 ERROR  : mysensors-adapter: Error decoding message from gateway, bad data received: I just blinked my LED
2021-02-28 13:20:48.451 ERROR  : mysensors-adapter: Not a valid message: not enough values to unpack (expected 5, got 0)
2021-02-28 13:20:48.621 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:48] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:49.039 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:49] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:49.619 ERROR  : Candle-manager-addon: 192.168.1.119 - - [28/Feb/2021 13:20:49] "�[37mGET /scanUSB HTTP/1.1�[0m" 200 -
2021-02-28 13:20:49.862 ERROR  : mysensors-adapter: Error decoding message from gateway, bad data received: Hello
2021-02-28 13:20:49.864 ERROR  : mysensors-adapter: Not a valid message: not enough values to unpack (expected 5, got 0)
2021-02-28 13:20:49.865 ERROR  : mysensors-adapter: Error decoding message from gateway, bad data received: Starting memory wipe.
2021-02-28 13:20:49.866 ERROR  : mysensors-adapter: Not a valid message: not enough values to unpack (expected 5, got 0)

That was a classic case of MySensors already being enabled before the candle receiver is made and plugged in. But since MySensors is disabled, that won't be the problem this time.

@createcandle
Copy link
Collaborator

Would you be willing to enable debugging in the addon settings, try again, and share the logs? It will create a lot of log data, but it will likely help me find the issue.

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 1, 2021 via email

@createcandle
Copy link
Collaborator

createcandle commented Mar 1, 2021

Ah, glad to hear that you managed to get the Candle receiver working :-)

By tomorrow you will hopefully have the new version on your system. Have a good evening.

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 1, 2021 via email

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 1, 2021 via email

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 1, 2021 via email

@createcandle
Copy link
Collaborator

just the internal log from the webthings gateway would be great.

But not the Candle Receiver I was able to create yesterday (with the reception info).

The receiver itself might not show up as a thing until mysensors is enabled again. Once the receiver is created, enable mysensors.

The MySensors is on. Does it mean it has to be disabled with each new thing?

No, this is only necessary when you're starting out. Once the receiver is created and is plugged in, you can start MySensors, and it will connect to the receiver. Then you can start creating more devices.

Unplugging the receiver and plugging in the « temperature and more »

Don't unplug the receiver. Once it's created, just leave it in there.

Just that the pressure based forecast stays at « unknown »

it will take a while before it has enough pressure readings to make a weather prediction.

Add by URL… http://gateway.local/things#

That's not relevant for Candle.

@createcandle
Copy link
Collaborator

Have you checked on this page? https://www.candlesmarthome.com/controller

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 2, 2021 via email

createcandle pushed a commit to createcandle/addon-list that referenced this issue Mar 2, 2021
mrstegeman pushed a commit to WebThingsIO/addon-list that referenced this issue Mar 2, 2021
@createcandle
Copy link
Collaborator

createcandle commented Mar 2, 2021

It sounds like it all worked ok.

Have you tried a reboot?

I don't see any issue in the log. By all accounts it should be working.

The screen will show a W if the wireless connection is established.

What's the distance between the climate sensor and the receiver?

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 2, 2021 via email

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 2, 2021 via email

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 2, 2021 via email

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 2, 2021 via email

@createcandle
Copy link
Collaborator

By « the screen », you mean the LCD of the climate sensor?

Yes

I must still keep hooked on the USB to create the « Thing » in the webthings/things?

No

Quick question: all transmission is through the nRF24 of the nano? The wifi and bluetooth of the Raspberry Pi are not used?

Correct

It shows a T but no W. (Webthings doesn’t show any W)

If it was connected properly it would also show a W (T = transmission allowed, W = wirelessly connected)

I’ve got a bunch of nanos with no RF and a bunch of separate transceivers with PA modules. They would work the same, wouldn’t they?

Any arduino with a NRF24(+) module should work, yes. You can find out how to connect the wires at mysensors.org. Candle is built on MySensors.

It seems that somehow the connection is not being established. If you install manually via the Arduino IDE software, then you could enable the debugging option and find out what's going on.

https://github.com/createcandle/Devices/blob/4aeecb04eabb44357b8a3cd8ef8f11118e1e3cba/Temperature_and_more/Temperature_and_more.ino#L44

Have you tried creating another device to and see if that created a working connection?

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 2, 2021 via email

@createcandle
Copy link
Collaborator

createcandle commented Mar 2, 2021

You can create all of the devices without having the actual sensors or actuators connected. It won't harm the Arduino. You may have to clear the eeprom when you create another device (the Candle manager does this automatically).

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 3, 2021 via email

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 8, 2021 via email

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 8, 2021 via email

@createcandle
Copy link
Collaborator

Thanks for the logs.

16:09:50.171 -> ! NOT CONNECTED TO GATEWAY indicates that a wireless connection was not established.

If you upload code from the Arduino, make sure the encryption password in the code is set to the same (auto-generated) password as in the Candle Manager addon's settings. Devices need to use the same password, or they won't be able to talk to each other.

This is not really relevant (since there is no connection in the first place), but what I also find .. odd is this:

16:09:50.376 -> Sending new data transmission state: 0
16:09:50.583 -> BC: hide T icon

That indicates the device is set to "do not send data to the controller" mode. But it's not issue. That toggle should still show up in the gateway, and then you can enable it. Also, I think earlier you told me that you do see a T on the screen.

Do you see something like #define MYDEBUG in the code? That's the debugging option for MySensors. It will allow us to learn more about what's wrong with the wireless connection.

Have you also tried to create another device?

@createcandle
Copy link
Collaborator

By the way, if another device also doesn't connect, you could also check out the debug logs from the Candle Receiver itself.

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 12, 2021 via email

@createcandle
Copy link
Collaborator

createcandle commented Mar 12, 2021

If you have an RF-Nano, don't comment out the RF-Nano define. On the RF-Nano those two pins are reversed.

Some of the RF Nano's are the plus variety, and some aren't. But the code has ben built in such a wat that it should handle both fine.

they also need the CH341 lib

yes, pretty much all Chinese Nano's use this chip. It works fine, and MacOS even supports it natively now.

avrdude: verification error, first mismatch at byte 0x7800

Never seen that before :-D

Arduino : 1.8.13 (Mac OS X), Carte : "Arduino Uno"

Are you using an Arduino Uno?

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 12, 2021 via email

@createcandle
Copy link
Collaborator

Yes I completely understand. It's a bit of a mystery to me. Thanks for your patients too, and for sharing the many logs. Perhaps the mystery will be revealed at some later date.

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 13, 2021 via email

@createcandle
Copy link
Collaborator

the model with the extra connector for an antenna

The what?? :-D Indeed, Candle Manager was never tested with those. Do you have a link where I can buy some?

@createcandle
Copy link
Collaborator

I've also found some issues with the latest Arduino CLI, and fixed those.

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 16, 2021 via email

@createcandle
Copy link
Collaborator

I think I found it. I've ordered two to see how it works.

@Lacitis36
Copy link
Author

Lacitis36 commented Mar 19, 2021 via email

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

Successfully merging a pull request may close this issue.

1 participant