Closed PandCall closed 9 months ago
Hi, @PandCall! Glad you find it useful. Could you please clarify? Current implementation do delete incoming messages right after reading them. You see otherwise? Please give some details.
I'll get back to you as soon as I fix my Home Assistant. After a reboot, node-red no longer launches with an error message telling me that /var/spool/sms/incoming does not exist. I've uninstalled node-red and reinstalled it, but now I can't launch it. I've restored a backup, still no node-red launch. Then I manually deleted all folders and configuration files that referred to node-red-huawei-sms. I'll be back as soon as node-red restarts properly. Regards
Ok, will wait. This module has nothing to do with /var/spool/sms/incoming. It does not use filesystem at all. It uses http to interact with stick. So I recommend you to review other recent changes to your setup.
I'm reinstalling the whole system and restoring the backup to an earlier date when everything was working. It's a bit long, but it should be fine. Once that's done, I'll do the system updates and then step by step I'll redo the installation for the SMS. Regards
The system has been up and everything seems to be working properly again. I'm checking that everything is stable before making any further modifications, and I'll get back to you with more details about your module.
Now the system is stable and I can start testing again. But I keep getting this message Error: No csrf token in /html/index.html And so it blocks the reading of SMS messages However, I can read the router information with another module in Home assistant or node-red. Do you have any idea why? Regards
Most likely you have different device or different firmware version. Can you get to the web interface of the stick and look there for "Device information" page? Even if it is slightly different it still can be incompatible as this is not stable official API. Below I will attach the page of my device.
I would like to make my module universal. If you can record a network trace and send it to me, I can try to support it. Here is the manual how to do that: https://learn.microsoft.com/en-us/azure/azure-web-pubsub/howto-troubleshoot-network-trace#collect-a-network-trace-in-the-browser-browser-based-apps-only . You need to open a blank page, start the trace and then go to your stick address, log in and send or get sms by clicking the interface. When I get the trace I can tell you if I can add support. Thanks in advance!
Sure, My system is not in production, it's in Lab mode. I can therefore run any kind of test. At this time, it's being used in Home assistant with the NODE-RED version included in the packages. Would you prefer me to run the tests in a direct Linux/Node-Red environment or under Home assistant? I'll run the tests as soon as I can Regards
Well, what I need for now you can do just with browser.
If I attach the HAR file here, is it public or private? Regards
It appears that you cannot share file privately via Github. But not a big deal though! I made new version 0.0.6 please give it a try. I did publish it, after some time there shoul be Update available in Manage Palette!
After updating and restarting, node-red no longer starts with this log.
21 Dec 18:39:30 - [info] Node-RED version: v3.1.0
21 Dec 18:39:30 - [info] Node.js version: v18.18.2
21 Dec 18:39:30 - [info] Linux 6.1.58-haos-raspi arm64 LE
21 Dec 18:39:32 - [info] Loading palette nodes
21 Dec 18:39:32 - [warn] [node-red-contrib-home-assistant-websocket] Node module cannot be loaded on this version. Requires: >=3.1.1
21 Dec 18:39:36 - [info] Dashboard version 3.6.2 started at /endpoint/ui
21 Dec 18:39:39 - [info] Settings file : /etc/node-red/config.js
21 Dec 18:39:39 - [info] Context store : 'default' [module=memory]
21 Dec 18:39:39 - [info] User directory : /config/
21 Dec 18:39:39 - [warn] Projects disabled : editorTheme.projects.enabled=false
21 Dec 18:39:39 - [info] Flows file : /config/flows.json
21 Dec 18:39:39 - [info] Server now running at http://127.0.0.1:46836/
21 Dec 18:39:40 - [info] Starting flows
[18:39:40] INFO: Starting NGinx...
21 Dec 18:39:40 - [info] [remote-access:f86af2c9431e2ec1] Server: InstanceHash:
21 Dec 18:39:40 - [info] [remote-access:f86af2c9431e2ec1] Configuration incomplete.
21 Dec 18:39:40 - [info] Started flows
21 Dec 18:39:40 - [info] [zigbee2mqtt-server:3f1ad22ac377d3f8] MQTT Connected
21 Dec 18:39:40 - [info] [mqtt-broker:NAS] Connected to broker: mqtt://192.168.69.3:1883
21 Dec 18:39:40 - [info] [zigbee2mqtt-server:3f1ad22ac377d3f8] MQTT Subscribed to: "zigbee2mqtt/#
2023-12-21 17:39:41 [error] [HuaweiMdm 192.168.8.1] Error: <?xml version="1.0" encoding="UTF-8"?>108003
108003
108003
108003
108003
108003
108003
108003
108003
108003
Node-Red restarts by removing this line from the modules
And of course my Flow SMS displays an error because the Node is missing. Regards
I will look in to it. The error 108003: "user already logged in" tells us that there is another session. Do you have other software that use the stick API at the same time? It seems unlikely, but plz check. For now I don't get how it could break NR completely.
Yes, in HA there is a module : https://www.home-assistant.io/integrations/huawei_lte which is connected to the router to access other information that you don't give, such as Upload Download Data On/Off Wifi On/Off Etc.
I disabled the HA module But randomly node-red down and when it manages to restart there's this message and it loops Up/down node-red service
Ok, thanks. For now I can tell you this.
@PandCall I was not able to catch NR failure with my module. There could be two possiblites:
As you can see in your log "exit with code 1" happens after 40 and something seconds after last exception from my module. Thats weird.
I have two suggestions.
I'll do it asap
@PandCall I didnt catch any total failure, but made some improvements. Please update to 0.0.7 and let me know if its working or not.
No, with each installation, NR falls and never rises again.
`
Index: 40005,
Phone: 336xxxxxxxxx,
Content: 'Ok',
Date: '2023-12-20 16:11:59',
Sca: '',
SaveType: 0,
Priority: 0,
SmsType: 1
},
{
Smstat: 0,
Index: 40004,
Phone: 336xxxxxxxxx,
Content: 'Il manque des messages',
Date: '2023-12-20 15:50:55',
Sca: '',
SaveType: 0,
Priority: 0,
SmsType: 1
},
{
Smstat: 0,
Index: 40003,
Phone: 336xxxxxxxxx,
Content: 3,
Date: '2023-12-20 15:39:14',
Sca: '',
SaveType: 0,
Priority: 0,
SmsType: 1
},
{
Smstat: 0,
Index: 40002,
Phone: 336xxxxxxxxx,
Content: 2,
Date: '2023-12-20 15:39:12',
Sca: '',
SaveType: 0,
Priority: 0,
SmsType: 1
},
{
Smstat: 0,
Index: 40000,
Phone: 336xxxxxxxxx,
Content: 1,
Date: '2023-12-20 15:39:11',
Sca: '',
SaveType: 0,
Priority: 0,
SmsType: 1
}
]
23 Dec 19:37:20 [debug] [Huawei SmsRcv 192.168.8.1] Sending msg to receiver #d482f60815f7e5f9
23 Dec 19:37:20 [debug] [HuaweiMdm 192.168.8.1] queueRequest delete [Arguments] { '0': 40009 }
23 Dec 19:37:20 [debug] [Huawei SmsRcv 192.168.8.1] Sending msg to receiver #d482f60815f7e5f9
23 Dec 19:37:20 [debug] [HuaweiMdm 192.168.8.1] queueRequest delete [Arguments] { '0': 40008 }
23 Dec 19:37:20 [debug] [Huawei SmsRcv 192.168.8.1] Sending msg to receiver #d482f60815f7e5f9
23 Dec 19:37:20 [debug] [HuaweiMdm 192.168.8.1] queueRequest delete [Arguments] { '0': 40006 }
23 Dec 19:37:20 [debug] [Huawei SmsRcv 192.168.8.1] Sending msg to receiver #d482f60815f7e5f9
23 Dec 19:37:20 [debug] [HuaweiMdm 192.168.8.1] queueRequest delete [Arguments] { '0': 40005 }
23 Dec 19:37:20 [debug] [Huawei SmsRcv 192.168.8.1] Sending msg to receiver #d482f60815f7e5f9
23 Dec 19:37:20 [debug] [HuaweiMdm 192.168.8.1] queueRequest delete [Arguments] { '0': 40004 }
23 Dec 19:37:20 - [red] Uncaught Exception:
23 Dec 19:37:20 - [error] TypeError: messages[i].Content.trim is not a function
at constructor.poll_success (/config/node_modules/@nickiv/node-red-huawei-sms/huawei-sms-config.js:85:61)
at constructor.handle (/config/node_modules/machina/lib/webpack:/src/BehavioralFsm.js:135:1)
at constructor.Fsm.
` I'll have to do the tests on a system with the Key and without HA, only with NR to see how it behaves.
@PandCall please check out 0.0.8 version. It is a dumb bug (trim is not a function). I fixed it. Please let me know if it works now.
I've just reinstalled it and it works and connects quickly. NR Log HA Now I'll restart HA and NR to check To be continued......
Restarting is no problem at the moment, everything seems to be working properly and cohabits with the HA Module, which will read some of the key's status. You must have put your finger on something that was causing this problem. I'm going to continue testing to validate stability. But if you make any changes, don't hesitate to let me know if you want me to test them. Regards
Actually it was your help. In the log above error is clearly visible "3 Dec 19:37:20 - [error] TypeError: messages[i].Content.trim is not a function". Thank you!
P.S. do not hesitate to file a ticket if you have any errors or may be feature requests!
Hi I love your module. I can now read SMS messages. I'd like you to think about upgrading your module to include the possibility of deleting the SMS after reading or deleting them periodically. Regards