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
SMS functions (send/receive) #6
Comments
My router can't do sms. But if you are willing to test it out. |
That was fast - I have tested, but get error 100005: Unknown and also 125003: Unknown after some tries
One thing I don't understand, is the huawei-lte-api folder, it's based of https://github.com/Salamek/huawei-lte-api-ts. Maybe I have to try some js CLI stuff first with the huawei-lte-api, to get the send working, and then afterwords look into receive function - "one step at a time" |
You got lucky. I had some time available today. Now I never learned too much about typescript(.ts files). But I do know that typescript can be compiled into javascript. So when i publish to npm just must first compile the source files (src/.ts) into build files (dist/.js). Error 100005 I dont know about. But 125003 is some sort of session error, ref. I made this test code which is basically what I put into the node-red module you tested. But this will run from command instead of through node-red. const huaweiLteApi = require('huawei-lte-api')
const TEST_PHONE_NUMBER = ['1233456']
const TEST_MESSAGE = 'Test message'
async function start () {
try {
const connection = new huaweiLteApi.Connection('http://admin:password@192.168.8.1/')
await connection.ready
const SMS = new huaweiLteApi.Sms(connection)
const result = await SMS.sendSms(TEST_PHONE_NUMBER, TEST_MESSAGE)
console.log(result)
} catch (error) {
console.error('Ended in error:')
console.error(error)
console.trace(error)
}
}
start() |
Still same result, but I have spend the day trying other solutions to try and find a way. But still - thanks for trying.
|
I get a OK back in console. I guess that means I got some sort of contact to the router but no SMSs are send. Do any of the my other node models work in node-red? Eg. can you reboot the device or turn of data? |
I know that reboot worked, but I will do some deeper testing this weekend.. |
Contacted Salamek who made the API, and it seems that encryption is not implemented yet in TS API, I got it working with send-sms via the py API om my PC (Windows). see more here |
@grawsom API has now been released to v 0.0.10 - it's suppose to fix your exact issue. Mind testing this branch again after latest bump?
|
@zinen - I have now tested with 2 dongles I have E3372h-320 and firmware updated E3372h-153 (so it runs hilink mode), and it works and not. So it must be the parsing that goes wrong. But so far so god. :-) |
Don't know how to update script, but after playing with it I came to this that works, if it's programmatily correct i don't know, but maybe it helps. I added these 2 lines
So it loks like this now
|
Realized the same thing. Updated the code just now. Also removed the message field in the node properties so know only
|
Just maybe an idear to the future - make 1 node that have a dropdown for all the "service" stuff you can call via API. Also if I compare to the old smstools (6 years) in node-red that uses AT commands, it also only have phonenumber in node. So now that there is a working sms-out (sms-send) for node-red, it's time for me to see if I can find out how to make/get a sms-in, so I can replace the smstools with hilink working dongles. Thanks one again for making this work - and you have a happy new year. |
Sweet that it works. I will include this branch in the main code after some cleanup. About restructuring. When you say service stuff. You mean reboot and mobile data?
The SMS-in is a nice feature but I dont know how to make it without a device to test on. There are multible steps involved in look though an inbox. I welcome a PR though. |
Have used Huawei E3372h-153 and E3372h-320 in a node-red application where I use send and recieve sms, I have used an old sms package "node-red-contrib-smstools" but is 6 years old.
But the new -320 have HiLink, have made some stuff to get it in "com mode" just for still been able to the old sms package.
I'm not a programmer but it was my wish?? to use the api in HiLink mode to get it to work this way.
I now found this where you have made the first steps - just so great.
Can we get sms send/receive functions - I will be very happy to help with testing etc.
The text was updated successfully, but these errors were encountered: