Coder Social home page Coder Social logo

nymea / nymea Goto Github PK

View Code? Open in Web Editor NEW
133.0 17.0 30.0 29.48 MB

The nymea IoT server repository.

License: GNU General Public License v3.0

CSS 0.21% Shell 0.49% QMake 1.07% C++ 93.12% C 4.35% JavaScript 0.37% Python 0.38%
iot qt5 server iot-platform c-plus-plus automation nymea hacktoberfest

nymea's Introduction

nymea - open source IoT edge server


nymea (/[n'aiːmea:]/ - is an open source IoT edge server. The plug-in based architecture allows to integrate protocols and APIs. With the build-in rule engine you are able to interconnect devices or services available in the system and create individual scenes and behaviours for your environment.

Quick start

Install nymea on a Raspberry Pi

We have created an image for your Raspberry Pi (all models) that comes with an array of plugins for different smart devices!

Use the Raspberry Pi imager and select nymea as operating system. You'll have the choice between a headless nymea:core setup or a kiosk image that contains nymea:core and nymea:app for Raspberry Pis with touch screen.

Alternatively, the image can be downloaded and flashed manually from here. We recommend the latest Raspberry Pi OS Bullseye core or kiosk image.

Get nymea:app here:

iOS Badge

Android Badge

Openstore Badge

macOS Badge

Snap Badge

Windows Badge

Manual download files of nymea:app can be found here.

A detailed description how to install and getting started with nymea can be found in the nymea | user documentation.

Getting help

If you want to present your project or want to share your newest developments you can share it in Our Forum

If you are facing any troubles, don't hesitate to reach out for us or the community members, we will be pleased to help you: Chat with us on Telegram or Discord

Developing with nymea

A detailed documentation on how to develop with nymea is available on the nymea | developer documentation.

Network discovery

When starting nymead as user without root privileges, the network device discovery will not available due to missing raw socket permission. If you still want to make use of this feature, the binary capabilities need to be adjusted.

sudo setcap cap_net_admin,cap_net_raw=eip /usr/bin/nymead

This will allow nymead to create raw sockets for ARP and ICMP network discovery tools even when nymead gets started as user without root privileges.

License


nymea is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.

nymea's People

Contributors

alpha-rd avatar doctorseus avatar loosrob avatar myshoeshurt avatar mzanetti avatar nymea-jenkins avatar t-mon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nymea's Issues

Browsing doesn't allow error messages

BrowseResult *result;
result->finish(Device::DeviceErrorHardwareFailure);

---> result->finish(Device::DeviceErrorHardwareFailure, tr("meaningful error message"));

Newer ConBee firmware not working with nymea 0.25

It appears as if nymea was not able to communicate with the ConnBee 1 USB stick.

Dmesg:
[ 2.033921] usb 1-1.2: new full-speed USB device number 3 using xhci_hcd
[ 2.182156] usb 1-1.2: New USB device found, idVendor=0403, idProduct=6015, bcdDevice=10.00
[ 2.182205] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2.182241] usb 1-1.2: Product: FT230X Basic UART
[ 2.182285] usb 1-1.2: Manufacturer: FTDI
[ 2.182314] usb 1-1.2: SerialNumber: DO00KHBK
[ 4.549797] usbcore: registered new interface driver usbserial_generic
[ 4.549866] usbserial: USB Serial support registered for generic
[ 4.583064] usbcore: registered new interface driver ftdi_sio
[ 4.583146] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 4.583586] usb 1-1.2: Detected FT-X
[ 4.602982] usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0

root@nymea:/home/nymea# ls -la /dev/serial/by-id/
total 0
drwxr-xr-x 2 root root 60 Dec 26 12:08 .
drwxr-xr-x 4 root root 80 Dec 26 12:08 ..
lrwxrwxrwx 1 root root 13 Dec 26 12:08 usb-FTDI_FT230X_Basic_UART_DO00KHBK-if00-port0 -> ../../ttyUSB0

/var/log/syslog with debug enabled - creating the network:
Dec 26 12:32:11 localhost nymead[485]: I | Zigbee: Start creating network for "/dev/ttyUSB0" 38400 nymeaserver::ZigbeeAdapter::ZigbeeBackendTypeDeconz ChannelMask("0x07fff800", (11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26))
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeNetwork: Using settings directory "/etc/nymea"
Dec 26 12:32:11 localhost nymead[485]: I | Zigbee: Network added ZigbeeNetwork(00:00:00:00:00:00:00:00, {9b9c67c7-3641-409d-8da7-2a46fd5724c8}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateUninitialized)
Dec 26 12:32:11 localhost nymead[485]: I | Zigbee: Starting ZigbeeNetwork(00:00:00:00:00:00:00:00, {9b9c67c7-3641-409d-8da7-2a46fd5724c8}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateUninitialized)
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeNetwork: Loading network from settings directory "/etc/nymea"
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeNetwork: Using ZigBee network database "zigbee-network-9b9c67c7-3641-409d-8da7-2a46fd5724c8.db"
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeInterface: Start UART interface "/dev/ttyUSB0" 38400
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeInterface: Interface enabled successfully on "/dev/ttyUSB0" 38400
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeNetwork: State changed ZigbeeNetwork::StateStarting
Dec 26 12:32:11 localhost nymead[485]: I | Zigbee: Network state changed ZigbeeNetwork(00:00:00:00:00:00:00:00, {9b9c67c7-3641-409d-8da7-2a46fd5724c8}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateStarting)
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeNetwork: Hardware controller is now available.
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeNetwork: Start zigbee network internally
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeNetwork: Generate new extended PAN ID...
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeNetwork: Reading current firmware version...
Dec 26 12:32:11 localhost nymead[485]: I | ZigbeeInterface: Send frame "0x0d 0x00 0x00 0x05 0x00 0xee 0xff"
Dec 26 12:32:16 localhost nymead[485]: #33[33m W | ZigbeeController: Reply timeout InterfaceReply("Request controller version", 0)#33[0m
Dec 26 12:32:16 localhost nymead[485]: #33[33m W | ZigbeeController: Request Deconz::CommandVersion finished with error Deconz::StatusCodeError#033[0m
Dec 26 12:32:16 localhost nymead[485]: I | ZigbeeNetwork: Retry to initialize network 1 / 10
Dec 26 12:32:16 localhost nymead[485]: I | ZigbeeNetwork: Reading current firmware version...
Dec 26 12:32:16 localhost nymead[485]: I | ZigbeeInterface: Send frame "0x0d 0x01 0x00 0x05 0x00 0xed 0xff"
Dec 26 12:32:21 localhost nymead[485]: #33[33m W | ZigbeeController: Reply timeout InterfaceReply("Request controller version", 1)#33[0m
Dec 26 12:32:21 localhost nymead[485]: #33[33m W | ZigbeeController: Request Deconz::CommandVersion finished with error Deconz::StatusCodeError#033[0m
--- SNIP ---
Dec 26 12:32:56 localhost nymead[485]: I | ZigbeeNetwork: Retry to initialize network 9 / 10
Dec 26 12:32:56 localhost nymead[485]: I | ZigbeeNetwork: Reading current firmware version...
Dec 26 12:32:56 localhost nymead[485]: I | ZigbeeInterface: Send frame "0x0d 0x09 0x00 0x05 0x00 0xe5 0xff"
Dec 26 12:33:01 localhost nymead[485]: #33[33m W | ZigbeeController: Reply timeout InterfaceReply("Request controller version", 9)#33[0m
Dec 26 12:33:01 localhost nymead[485]: #33[33m W | ZigbeeController: Request Deconz::CommandVersion finished with error Deconz::StatusCodeError#033[0m
Dec 26 12:33:01 localhost nymead[485]: #33[33m W | ZigbeeNetwork: Failed to read firmware version after 10 attempts. Giving up#033[0m
Dec 26 12:33:01 localhost nymead[485]: #33[33m W | ZigbeeNetwork: Hardware controller is not available any more.#33[0m
Dec 26 12:33:01 localhost nymead[485]: #33[33m W | Zigbee: Network error occured for ZigbeeNetwork(00:00:00:00:00:00:00:00, {9b9c67c7-3641-409d-8da7-2a46fd5724c8}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateStarting) ZigbeeNetwork::ErrorHardwareUnavailable#033[0m
Dec 26 12:33:01 localhost nymead[485]: I | ZigbeeNetwork: State changed ZigbeeNetwork::StateOffline
Dec 26 12:33:01 localhost nymead[485]: I | Zigbee: Network state changed ZigbeeNetwork(00:00:00:00:00:00:00:00, {9b9c67c7-3641-409d-8da7-2a46fd5724c8}, Zigbee::ZigbeeBackendTypeDeconz, Channel: 0, ZigbeeNetwork::StateOffline)
Dec 26 12:33:01 localhost nymead[485]: I | ZigbeeInterface: Interface disabled

Thanxs for help

Nymea Package installation issue

Hi,

I am using ubuntu focal 20.04.
Nymea Core (Server): 1.3.1

When installing a package using the settings -> update -> install software interface, I cannot install any packages.
When I click to install it tries to install but nothing gets installed. I have even tried to restart the system using the nymea::app and even reboot the server altogether.

The live logs are giving me this error:
RemoteProxyClientTcpSocket: Socket error occurred QAbstractSocket::HostNotFoundError "Host not found"

So I looked at the /var/log/syslog system logs and in their I see I am getting:

get-packages transaction /247_ddaecdcc from uid 0 finished with success after 3197ms
get-updates transaction /248_dcacadaa from uid 0 finished with success after 316ms
update-packages transaction /249_deabdbdc from uid 0 finished with failed after 310ms

Crash when a NetworkDeviceDiscovery finishes

Another crash in the NetworkDeviceDiscovery, when a discovery finishes. This is the last debug output:

Oct 23 20:17:02 nymea nymead[10120]:  W | NetworkDeviceDiscovery: All ping replies finished for discovery. 35
Oct 23 20:17:02 nymea nymead[10120]:  I | NetworkDeviceDiscovery: Discovery finished. Found 37 network devices in "00:20.149"

And the stack trace:

(gdb) bt
#0  0xb6c213b4 in operator() (__closure=0x126a3c0) at hardware/network/networkdevicediscoveryimpl.cpp:144
#1  QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, nymeaserver::NetworkDeviceDiscoveryImpl::discover()::<lambda()> >::call (
    arg=<optimized out>, f=...) at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:146
#2  QtPrivate::Functor<nymeaserver::NetworkDeviceDiscoveryImpl::discover()::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...)
    at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:256
#3  QtPrivate::QFunctorSlotObject<nymeaserver::NetworkDeviceDiscoveryImpl::discover()::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=-1092024120, this_=0x126a3b8, r=<optimized out>, a=<optimized out>, ret=0x0)
    at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:443
#4  0xb65ba544 in QMetaCallEvent::placeMetaCall(QObject*) () from /lib/arm-linux-gnueabihf/libQt5Core.so.5
#5  0xb65bf570 in QObject::event(QEvent*) () from /lib/arm-linux-gnueabihf/libQt5Core.so.5
#6  0xb658bc2c in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib/arm-linux-gnueabihf/libQt5Core.so.5
#7  0xb658f0f0 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib/arm-linux-gnueabihf/libQt5Core.so.5
#8  0xb65f3554 in ?? () from /lib/arm-linux-gnueabihf/libQt5Core.so.5
#9  0xb428972c in g_main_context_dispatch () from /lib/arm-linux-gnueabihf/libglib-2.0.so.0
#10 0x00000000 in ?? ()

And the related code:

    if (alreadyRunning) {
        // Add already discovered network device infos in the next event loop
        // so any connections after this method call will work as expected
        QTimer::singleShot(0, reply, [this, reply](){
            foreach (const NetworkDeviceInfo &networkDeviceInfo, m_currentReply->networkDeviceInfos()) {
                reply->addCompleteNetworkDeviceInfo(networkDeviceInfo);
            }
        });

m_currentReply is not existing any more. Looks like this happens when a new discovery is started before, but in the same event loop pass when an existing discovery finishes. By the time results are copied over (in a delayed slot), m_currentReply is already set to nullptr.

By reading the code this should be reproducible by calling discover() in a discovery finished() slot, but it may also happen by coincidence.

non-cached state changes won't appear in logs if changed by restart

States that are not cached (cached: false in plugin json) might be changed during startup by the system when defaulting back to their default values. Such state changes are not recorded in the log DB.

Most obvious with the connected state:

  • Set up a connectable thing.
  • Once it's connected, shut down nymea.
  • Prevent the thing from connecting back (e.g. remove battery or something)
  • Start nymea

The state will now be reset to false, which is correct, however, looking at a graph of the thing, it will still appear as connected in the graph because the log history doesn't contain the disconnected event.

Contributor License Agreement

@mzanetti @tijuca @lampi87 @t-mon @myshoeshurt @Boernsman @tonnenpinguin @ni-cc

Hello,

you are receiving this email because you are contributing to nymea or have done so in the past. First of all, let us thank you for that!

Nymea, being a Qt project, is using the Qt framework extensively. As we've grown, our relationship to Qt has also matured over time. This manifested in cooperations to demonstrate nymea at exhibitions together with the Qt framework, working together on new APIs and similar. We are continuously working to extend this relationship and in order to provide easier collaboration with the upstream Qt framework, we'd like to streamline our licensing with the the Qt framwork license. This implies for one bumping the used license from GPLv2 to GPLv3 which should grant users and developers even more freedom, but in order to prevent nymea from being a success in commercial products too, we'd like to add a dual-licensing model, just the same as the Qt framework has.

As you've all contributed to this open source project, we're kindly asking you to sign a contributors license agreement so we can do the license switch. Please understand that in order to comply with those plans, we'd sadly be forced to remove contributions from authors who are not accepting this change.

Again, we'd like to thank you for your efforts and hope to be able to continue this journey together.

190304 guh individual CLA V1.pdf
Please send the signed document to [email protected]

Can't log in to tuya Cloud

When I'm trying to log in to the tuya cloud via the plugin, it is not recognising my username and password, even though I have entered the correct details.

Log:
I | Tuya: Pairing Tuya service
I | Tuya: Response from tuya api: {
"errorMsg": "Get accesstoken failed. Username or password error!",
"responseStatus": "error"
}

I | Tuya: Error response from service.
W | ThingManager: ConfirmPairing failed for "Tuya cloud login" QUuid("{dd6dcd91-f667-45a5-9594-12b95f94337e}")

Units cleanup

There are way too many units, used randomly. Changing this would be an API breaking change so listing considerations here for a time when we're ok with an API breakage.

Units should be aligned to always use SI units throughout the API. A client may convert them to something more suitable to the particular use case, localisation etc.

Plugin Tuya does not have cloud

Good morning,

I need a little help because your plugin is not as described in the list of integrations. I have installed the Core in a raspberry Pi 4 without any problem. But I've looked at the list of integrations and I've seen yours plugin that says:

"This plugin allows to make use of Tuya based devices through the Tuya cloud. This includes all the devices that work with the Smart Life app.
The plugin will allow logging in with the Smart Life app account and fetch all the devices connected to the Tuya / Smart Life cloud. "

But when entering the list of plugins in the App what I see is only this:

Capture
Capture1

I do not see at any time the option to connect to the cloud with my username and password to be able to adopt the devices of the Smart Life APP as the plugin says it has to do.

Can you please help me understand why this happens? Do I have to download the plugin manually? I am doing something wrong ? Do I have to do an update?

Thank you very much and a good day.

Reconfiguring things doesn't behave properly

There are some issues with reconfiguring things:

  • Reconfiguring a thing that requires pairing currently does not remove the old thing.
    i.e. reconfiguring a hue bridge will cause a second one to be set up but never destroy the first one

  • Reconfiguring a thing with childs, does not reconfigure the childs
    i.e. reconfiguring a shelly and changing the "connected device" parameter will not work as expected.

Advance password change

Hey team. We wonder if there is anyway to do an "advance" password change.
Situation: We have some pi zero's in the field. They are connected via wifi. We can ssh into them.
Sometimes the location where they are at changes the wifi password. We have advance notice, and it would be nice to be able to ssh in while they are still connected and the wifi password hasnt changed, and schedule or do something that would make it use the new password when it changes.

Thanks in advance for any ideas.

I2C manager add read/write with specific register

The current implementation has not way to read a specific register.
Note that there are 2 types of I2C device, those with just a single register
that doesn't have a register address and those with multiple registers.

Smart Meter Interface

Remodel to interfaces:

  • energymeter interface
    • extends sensor interface
    • totalEnergyConsumed [Wh] double
    • totalEnergyProduced [Wh] double (optional)
  • powermeter interface
    • extends sensor interface
    • activePower [W] double

Occational crashes in NetworkDeviceDiscovery

I don't see this often, but it happens. Seems something is still going on:

(gdb) bt
#0  0xb6c1dc50 in QHash<MacAddress, NetworkDeviceInfo>::findNode(MacAddress const&, unsigned int*) const ()
   from /usr/lib/arm-linux-gnueabihf/libnymea-core.so.1
#1  0xb6c204d0 in nymeaserver::NetworkDeviceDiscoveryReplyImpl::processMacManufacturer(MacAddress const&, QString const&) ()
   from /usr/lib/arm-linux-gnueabihf/libnymea-core.so.1
#2  0xb6c121a4 in ?? () from /usr/lib/arm-linux-gnueabihf/libnymea-core.so.1
#3  0xb65d2044 in ?? () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#4  0xb6c0f4e4 in nymeaserver::MacAddressDatabase::onLookupFinished() () from /usr/lib/arm-linux-gnueabihf/libnymea-core.so.1
#5  0xb65d2044 in ?? () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#6  0xb63a31e8 in QFutureWatcherBase::event(QEvent*) () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#7  0xb6592c2c in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#8  0xb65960f0 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#9  0xb65fa554 in ?? () from /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5
#10 0xb42a972c in g_main_context_dispatch () from /usr/lib/arm-linux-gnueabihf/libglib-2.0.so.0
#11 0x00000000 in ?? ()

Networking API needs cleanup

  • WirelessNetworkDevice is not registered by QMetaObject system but manually and "r:" modifiert have been forgotten. Should be changed in a way that the QMetaObject system can deal with it.

  • Return value of GetNetworkingStatus is not defined properly. It holds an anonymous object which is registered manually. Should probably return values directly, without the status object wrapping as the API doesn't use anonymous objects normally.

nymead can not be terminated during start up phase

I came across the following issue while developing a plugin. I start the daemon not in daemon mode, but from the terminal to do some plugin debugging. When hitting ctrl+c too early, the program pretends to shutdown, but actually never does. You can see the logs of such a run attached. Sending ctrl+c repeatedly leads to more messages that the program tries do exit, but this is never happening.

nymead_errors.txt

Nymea core doesn't work out of the box from a snap

Platform: Raspberry pi 4
OS: Ubuntu Core 18 - ubuntu-core-18-armhf+raspi
Nymea: 0.23.1+202009251004 revision 832

Brand new install, nymea was the first thing I installed following https://nymea.io/documentation/users/installation/core#from-the-snap-store

The application wouldn't start up:

sudo journalctl -xe

Dec 01 23:10:14 localhost nymea.nymead[3042]:  I | Platform: Loading platform plugins from: "/snap/nymea/832/usr/lib/arm
Dec 01 23:10:14 localhost nymea.nymead[3042]:  W | PlatformZeroConf: Error creating avahi client: -26
Dec 01 23:10:14 localhost nymea.nymead[3042]: nymead: browser.c:366: avahi_service_type_browser_new: Assertion `client'
Dec 01 23:10:14 localhost nymea.nymead[3042]: Aborted

Installed avahi and connected it

snap install avahi
snap connect nymea:avahi-control avahi:avahi-control
snap restart nymea

Works now

Don't know if it's a bug having a plugin installed that doesn't work out the box, or the instructions should've told me to install avahi

[Python Integration Plugin] setupThing() is called before init() completed

My python plugin requires a bit more time (2 seconds) in order to complete its initialization within init().

Only then the routines in setupThing() would be able to succeed. I noticed that setupThing() is called even if init() is not yet completed so at this point the integration plugin is not ready and it fails.

Inform the plugin if an action is executed by the user or by some automatism

This might be important to know for some devices, e.g. garage doors which are required to not close in some circumstances. I.e. if a garage door does not have a light sensor bar, it must never close automatically by a rule to prevent damaging something.

Other use cases might be to prioritize a single request by a user over a queue of automated ones. I.e. if a script animation animates a color light, the plugin might build up a queue of pending commands. To still react timely to a user interaction (e.g. power off), this information might be of use to a plugin.

Considerations for plugin setup process API

  • We need a way to make pairing optional: For instance, by having a flag in ThingPairingInfo which can be set by pairThing() to skip the actual pairing. (Perhaps AddThing and PairThing could be merged into one?)

  • There are circumstances where a discovery for a reconfiguration would need to know which thing is reconfigured. For example in cases where hardware cannot be identified uniquely (e.g. serial port devices often don't have a serial number or anything and the device path is not necessarily static all the time).

File for the cached Thing states is written after every change of the state

The function storeThingState in ThingManagerImplementation writes every time after a cached thing is changed to the permanent storage.
The destructor destroys the settings object and any changes will be written to permanent storage.

pi@raspberrypi:/var/cache/nymea/thingstates# stat 68e376be-f482-4beb-b7dd-10c3add90d79.cache 
  File: 68e376be-f482-4beb-b7dd-10c3add90d79.cache
  Size: 1018      	Blocks: 8          IO Block: 4096   regular file
Device: b301h/45825d	Inode: 15165       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-10-18 19:36:05.307630844 +0200
Modify: 2022-10-18 19:36:05.307630844 +0200
Change: 2022-10-18 19:36:05.317631206 +0200
 Birth: -
pi@raspberrypi:/var/cache/nymea/thingstates# stat 68e376be-f482-4beb-b7dd-10c3add90d79.cache 
  File: 68e376be-f482-4beb-b7dd-10c3add90d79.cache
  Size: 1018      	Blocks: 8          IO Block: 4096   regular file
Device: b301h/45825d	Inode: 15165       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-10-18 19:36:06.337668135 +0200
Modify: 2022-10-18 19:36:06.337668135 +0200
Change: 2022-10-18 19:36:06.347668497 +0200
 Birth: -
pi@raspberrypi:/var/cache/nymea/thingstates# stat 68e376be-f482-4beb-b7dd-10c3add90d79.cache 
  File: 68e376be-f482-4beb-b7dd-10c3add90d79.cache
  Size: 1019      	Blocks: 8          IO Block: 4096   regular file
Device: b301h/45825d	Inode: 15165       Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-10-18 19:36:16.308029197 +0200
Modify: 2022-10-18 19:36:16.308029197 +0200
Change: 2022-10-18 19:36:16.318029560 +0200
 Birth: -

Log DB issues

On certain devices, there is an issue with the database. Journal log:

guhio.nymead[597]: W | LogEngine: Error writing log entry. Driver error: "Unable to fetch row" Database error: "database disk image is malformed"

add command line parameters for used config file and other paths

Ideally we'd get rid of all the paths magic in nymeasettings, initialize them with just one sane default (probably QStandardDir) and if something special is needed, e.g. for the snap package, it should be configured in the snap launcher as command line argument.

Userconfiguration

When adding a new User the Name of the user is not shown in the Userlist

image

However when leaving the UserConfigurations and reenter the Userlist the User magically appears

image

Crash in NetworkDeviceDiscoveryImpl::unregisterMonitor

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0xb6d6536e in nymeaserver::NetworkDeviceDiscoveryImpl::unregisterMonitor(NetworkDeviceMonitor*) () from /lib/arm-linux-gnueabihf/libnymea-core.so.1
[Current thread is 1 (Thread 0xb2aa57d0 (LWP 309))]
(gdb) bt
#0  0xb6d6536e in nymeaserver::NetworkDeviceDiscoveryImpl::unregisterMonitor(NetworkDeviceMonitor*) () from /lib/arm-linux-gnueabihf/libnymea-core.so.1
#1  0xaee5411e in IntegrationPluginGoECharger::<lambda()>::operator()(void) const (__closure=<optimized out>) at integrationplugingoecharger.cpp:402
#2  0xb5f31580 in QMetaObject::activate(QObject*, int, int, void**) () from /lib/arm-linux-gnueabihf/libQt5Core.so.5
#3  0xb63a0668 in ?? () from /lib/arm-linux-gnueabihf/libQt5Network.so.5

NetworkDeviceDiscovery MAC lookup seems wrong

Following example:

Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.10", "74:83:c2:20:8f:1f" ("Ubiquiti Networks Inc.") , hostname: "3881D7319CAD-mysimplelink", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.11", "74:ac:b9:a9:c4:b5" ("Ubiquiti Networks Inc.") , hostname: "RingPro-54", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.13", "3c:71:bf:2c:78:e0" ("Espressif Inc.") , hostname: "shelly1-2C6D05", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.14", "3c:71:bf:2c:6d:05" ("Espressif Inc.") , hostname: "shellyplug-s-6A5D6B", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.18", "1c:12:b0:57:3c:32" ("Amazon Technologies Inc.") , hostname: "shelly1-2BE983", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.19", "18:74:2e:88:f8:f2" ("Amazon Technologies Inc.") , "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.20", "3c:e1:a1:ad:ea:54" ("Universal Global Scientific Industrial Co., Ltd.") , hostname: "shelly1-483FDA6F2E7B", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.22", "ec:e5:12:12:b2:ba" ("tado GmbH") , hostname: "shelly1-483FDA942832", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.26", "cc:4b:73:3b:78:84" ("AMPAK Technology, Inc.") , hostname: "amazon-85845a898", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.27", "48:3f:da:94:28:32" ("Espressif Inc.") , hostname: "XXX-MacBookPro", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.28", "84:cc:a8:ad:ec:27" ("Espressif Inc.") , hostname: "nymea-energy", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.30", "48:3f:da:6f:2e:7b" ("Espressif Inc.") , hostname: "shelly1-483FDA6F2E7B.localdomain", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.41", "9e:19:ea:31:f6:8b", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.58", "e0:98:06:a4:0f:63" ("Espressif Inc.") , hostname: "shellyplug-s-A40F63.localdomain", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.60", "d8:5e:d3:13:14:3e" ("GIGA-BYTE TECHNOLOGY CO.,LTD.") , hostname: "Mi10-Mi10.localdomain", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.61", "d8:5e:d3:13:14:40" ("GIGA-BYTE TECHNOLOGY CO.,LTD.") , hostname: "SynologyNAS.localdomain", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.67", "c4:ac:59:4b:f5:e7" ("Murata Manufacturing Co., Ltd.") , "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.81", "34:86:5d:1b:b3:7c" ("Espressif Inc.") , hostname: "xcf1d-nymea-zigbee-buster-amd64-armhf.localdomain", "wlan0")
Jun 08 10:52:01 nymea-experimental nymead[21148]:  I | Wallbe: NetworkDeviceInfo("10.10.10.83", "58:d5:0a:ad:43:5c" ("Murata Manufacturing Co., Ltd.") , hostname: "xe5b9-nymea-zigbee-focal-amd64-amd64.localdomain", "wlan0")

Most of the resolved MAC manufacturers seem not to match. For instance, the Amazon Ring doorbell is listed as Ubiquiti, while a Shelly devices are listed as Amazon, Espressif (probably the correct one), Tado etc...

Sonoff device setup call failed: QNetworkReply::NetworkError(ContentNotFoundError)

Sonoff-Tasmota 6.4.1 by Theo Arends
nymead:
Installed: 0.11.1+201902151905ff61548stretch
Candidate: 0.11.1+201902151905ff61548stretch
Version table:
*** 0.11.1+201902151905ff61548stretch 500
500 http://ci-repo.nymea.io/landing-silo stretch/main armhf Packages
100 /var/lib/dpkg/status
0.11.0+201901171613a49a1e6stretch 500
500 http://repository.nymea.io stretch/main armhf Packages

https://forum.nymea.io/t/failed-connect-sonoff-touch/117/4

 I | JsonRpc: Invoking method "Devices" AddConfiguredDevice
 I | Mqtt: Suitable MQTT server for "192.168.100.191" found at "192.168.100.147" on port 1883
 I | Mqtt: Policy for client "e1e1e7aac6c94e9fbaf2cc2138990f85" added.
 I | Tasmota: Sonoff device setup call failed: QNetworkReply::NetworkError(ContentNotFoundError) "Error transferring http://192.168.100.191/sv?w=2%2C1&mh=192.168.100.147&ml=1883&mc=e1e1e7aac6c94e9fbaf2cc2138990f85&mu=b4e00a4c2c704c05a8eb799ae93b7b39&mp=898ce6ea66a544c5b4f64d2b8edc37d6&mt=sonoff&mf=e1e1e7aac6c94e9fbaf2cc2138990f85/%25topic%25/ - server replied: Not Found" "File Not Found\n\nURI: /sv\nMethod: GET\nArguments: 8\n w: 2,1\n mh: 192.168.100.147\n ml: 1883\n mc: e1e1e7aac6c94e9fbaf2cc2138990f85\n mu: b4e00a4c2c704c05a8eb799ae93b7b39\n mp: 898ce6ea66a544c5b4f64d2b8edc37d6\n mt: sonoff\n mf: e1e1e7aac6c94e9fbaf2cc2138990f85/%topic%/\n"
 I | Mqtt: Policy for client "e1e1e7aac6c94e9fbaf2cc2138990f85" removed
 I | Mqtt: Released MQTT channel for client ID "e1e1e7aac6c94e9fbaf2cc2138990f85"
 W | DeviceManager: "Error in device setup. Device sonoff_dual ({e1e1e7aa-c6c9-4e9f-baf2-cc2138990f85}) will not be added to the configured devices."
 I | JsonRpc: Got a device setup finished "sonoff_dual" QUuid("{e1e1e7aa-c6c9-4e9f-baf2-cc2138990f85}")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.