bureus / mmm-postnord Goto Github PK
View Code? Open in Web Editor NEWMagic Mirror Module - Automatically track and trace PostNords letters, parcels and pallets with your phone number or email
Magic Mirror Module - Automatically track and trace PostNords letters, parcels and pallets with your phone number or email
`WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/config/config.js:131
deliveredPackagesCooldown: "3"
^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:722:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
at Module.load (internal/modules/cjs/loader.js:645:32)
at Function.Module._load (internal/modules/cjs/loader.js:560:12)
at Module.require (internal/modules/cjs/loader.js:685:19)
at require (internal/modules/cjs/helpers.js:16:16)
at loadConfig (/home/pi/MagicMirror/js/app.js:70:12)
at App.start (/home/pi/MagicMirror/js/app.js:217:3)
at Object.<anonymous> (/home/pi/MagicMirror/js/electron.js:129:7)
at Module._compile (internal/modules/cjs/loader.js:786:30)`
i tryed everything with this module with no succes each time i add it to the config.js file mirror crashes and tells me to reconfigure the file
here is what im pasting in to it
...
{
module: "MMM-Postnord",
position: "bottom_left",
config: {
locale: "sv", //Optional, default is 'sv' allowed codes 'en', 'da', 'fi', 'no', 'sv'
refreshRateMin: "60" //Optional, default is 60 min
deliveredPackagesCooldown: "24" //Optional, hours a package should be visible until removed, default null always visible.
}
},
...
tryed without ... and in start of the file and in bottom same issue keeps crashing and telling me config file is not correct configed
I am trying to configure the plugin for Norway but somehow, it fails.
I am trying to run "node postnord-hash-generator.js new" with different values as phone number and different values as languate -they all fail with invalid input.
The phone number has been tried in the form "+4740xxxxxx", "004740xxxxxx", "4740xxxxxx" and "40xxxxxx".
For the country, it's obvious - it should be NO.
For the language I have tried with both no and en.
As far as I can tell, there is a validation on 11 digits for the phone number (once it was changed to 10, it will work) - the validation should be based on the country code (11 for Sweden, 10 for Norway, etc.).
pi@raspberrypi:~/MagicMirror/modules/MMM-Postnord $ node postnord-hash-generator.js new
Enter subscriptionId (either phone number example 46702136611 or email example [email protected]), country ('SE', 'NO', 'FI', 'DK') and language ('en', 'sv', 'no', 'da', 'fi'):
4612345678 SE sv
Please wait until you recives a 4 digit code on your email: 4612345678
Type in validation code that you will recive thru SMS or email:
generateSubscription failed: {"name":"StatusCodeError","statusCode":503,"message":"503 - undefined","options":{"method":"POST","uri":"https://appi.postnord.com/rest/customer/v1/identity/register/4612345678?apikey=591aa0cdb8cf85d41fede9b027b1e1c7","headers":{"User-Agent":"PostNord/6.5.2-Android","Connection":"Keep-Alive","Host":"appi.postnord.com","Accept-Encoding":"gzip","Content-Type":"application/json; charset=UTF-8"},"json":true,"body":{"deviceid":"07627a83-e8e2-4877-b0a4-55b521b2a360","language":"sv","country":"SE","licenseversion":2},"simple":true,"resolveWithFullResponse":false,"transform2xxOnly":false},"response":{"statusCode":503,"headers":{"content-length":"0","connection":"keep-alive"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"appi.postnord.com","port":443,"hostname":"appi.postnord.com","hash":null,"search":"?apikey=591aa0cdb8cf85d41fede9b027b1e1c7","query":"apikey=591aa0cdb8cf85d41fede9b027b1e1c7","pathname":"/rest/customer/v1/identity/register/4612345678","path":"/rest/customer/v1/identity/register/4612345678?apikey=591aa0cdb8cf85d41fede9b027b1e1c7","href":"https://appi.postnord.com/rest/customer/v1/identity/register/4612345678?apikey=591aa0cdb8cf85d41fede9b027b1e1c7"},"method":"POST","headers":{"User-Agent":"PostNord/6.5.2-Android","Connection":"Keep-Alive","Host":"appi.postnord.com","Accept-Encoding":"gzip","Content-Type":"application/json; charset=UTF-8","accept":"application/json","content-length":101}}}}
My questions:
1: Valid API key?
2. Deprecated API? (since postnord dev-doc refer to api2.postnord.com as host
3. Update to https://guides.developer.postnord.com/#ddf7f133-ed64-4703-ab67-ba295a82c2b3 or something here https://developer.postnord.com/apis ?
Is it possible to make the Postnord logo visible all the time? Now it is visible only before the list appears.
Module wont load, recreated the hash = noavail:
0|mm | [15.09.2022 22:06.41.400] [WARN]
0|mm | Unhandled rejection ReferenceError: response is not defined
0|mm | at /home/micke/MagicMirror/modules/MMM-Postnord/node_helper.js:164:15
0|mm | at tryCatcher (/home/micke/MagicMirror/modules/MMM-Postnord/node_modules/bluebird/js/release/util.js:16:23)
0|mm | at Promise._settlePromiseFromHandler (/home/micke/MagicMirror/modules/MMM-Postnord/node_modules/bluebird/js/release/promise.js:547:31)
0|mm | at Promise._settlePromise (/home/micke/MagicMirror/modules/MMM-Postnord/node_modules/bluebird/js/release/promise.js:604:18)
0|mm | at Promise._settlePromise0 (/home/micke/MagicMirror/modules/MMM-Postnord/node_modules/bluebird/js/release/promise.js:649:10)
0|mm | at Promise._settlePromises (/home/micke/MagicMirror/modules/MMM-Postnord/node_modules/bluebird/js/release/promise.js:725:18)
0|mm | at _drainQueueStep (/home/micke/MagicMirror/modules/MMM-Postnord/node_modules/bluebird/js/release/async.js:93:12)
0|mm | at _drainQueue (/home/micke/MagicMirror/modules/MMM-Postnord/node_modules/bluebird/js/release/async.js:86:9)
0|mm | at Async._drainQueues (/home/micke/MagicMirror/modules/MMM-Postnord/node_modules/bluebird/js/release/async.js:102:5)
0|mm | at Immediate.Async.drainQueues [as _onImmediate] (/home/micke/MagicMirror/modules/MMM-Postnord/node_modules/bluebird/js/release/async.js:15:14)
0|mm | at processImmediate (node:internal/timers:466:21)
After git pull
and npm install
the guide tells you to run node postnord-hash-generator.js help
. However, that does not give me the help text needed to go forward, instead it generates an error:
pi@raspberrypi:~/MagicMirror/modules/MMM-Postnord $ node postnord-hash-generator.js help
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module 'awesome-phonenumber'
Require stack:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.