TR-069 client simulator for GenieACS.
To install:
git clone https://github.com/zaidka/genieacs-sim.git
cd genieacs-sim
npm install
To use:
./genieacs-sim --help
TR-069 client simulator for GenieACS
Home Page: https://genieacs.com
License: MIT License
Simulator 000000 started
Simulator 000000 listening for connection requests on http://10.10.1.250:42333/
/root/genieacs-sim/xml-utils.js:6
for (const [k, v] of Object.entries(attrs)) attrsStr += ${k}="${v}"
;
^
TypeError: Object.entries is not a function
at Object.node (/root/genieacs-sim/xml-utils.js:6:31)
at Object.inform (/root/genieacs-sim/methods.js:31:29)
at startSession (/root/genieacs-sim/simulator.js:109:11)
at listenForConnectionRequests (/root/genieacs-sim/simulator.js:294:5)
at Server.httpServer.listen.err (/root/genieacs-sim/simulator.js:256:14)
at Server.g (events.js:292:16)
at emitNone (events.js:91:20)
at Server.emit (events.js:185:7)
at emitListeningNT (net.js:1297:10)
at _combinedTickCallback (internal/process/next_tick.js:77:11)
Simulator 000000 died (1). Restarting in 10 seconds...
Hello everyone,
I am trying to simulate an enodeb and I came across a file named femto_default.xml
. The file describes the entire device and contains thousand of lines [...]. By chance, does someone already has a script
to convert such data into a CSV data model?
Preview of femto_default.xml
:
<SERCOMM_CML>
<Element Name="Device." DataType="object" Permissions="7,7">
<Element Name="RootDataModelVersion" notifyMode="Off" default="2.4" DataType="string(32)" Permissions="5,5"></Element>
<Element Name="IPsec." DataType="object" Permissions="5,5">
<Element Name="Enable" Writable="1" notifyMode="Off" default="0" DataType="boolean" Permissions="3,3"></Element>
<Element Name="Status" notifyMode="Off" default="Disabled" DataType="string(32)" SaveType="SM" Permissions="5,5"></Element>
<Element Name="MyKeyMode" Writable="1" notifyMode="Off" default="" DataType="string(32)" Permissions="3,3"></Element>
<Element Name="AHSupported" notifyMode="Off" default="1" DataType="boolean" Permissions="3,3"></Element>
<Element Name="IKEv2SupportedEncryptionAlgorithms" notifyMode="Off" default="DES,3DES,BLOWFISH,AES-CBC" DataType="string" Permissions="3,3"></Element>
<Element Name="ESPSupportedEncryptionAlgorithms" notifyMode="Off" default="NULL,DES,3DES,BLOWFISH,AES-CBC" DataType="string" Permissions="5,5"></Element>
<Element Name="IKEv2SupportedPseudoRandomFunctions" notifyMode="Off" default="HMAC-MD5,HMAC-SHA1,HMAC-SHA2-256,HMAC-SHA2-384,HMAC-SHA2-512,AES-128-CMAC" DataType="string" Permissions="3,3"></Element>
<Element Name="SupportedIntegrityAlgorithms" notifyMode="Off" default="NONE,HMAC-MD5-96,HMAC-SHA1-96,DES-MAC,HMAC-MD5-128,AES-CMAC-96,HMAC-SHA2-256-128,HMAC-SHA2-256-192,HMAC-SHA2-256-256" DataType="string" Permissions="3,3"></Element>
<Element Name="SupportedDiffieHellmanGroupTransforms" notifyMode="Off" default="NONE,MODP-768,MODP-1024,MODP-1536,MODP-2048" DataType="string" Permissions="3,3"></Element>
</Element>
<Element Name="SoftwareCtrl." DataType="object" Permissions="5,5">
<Element Name="AutoActivateEnable" Writable="1" notifyMode="Off" default="1" DataType="boolean" Permissions="5,5"></Element>
<Element Name="SystemBackupVersion" notifyMode="Off" default="Device.DeviceInfo.X_SCM_BackupSoftwareVersion" DataType="string" SaveType="LM" Permissions="7,7"></Element>
<Element Name="SystemCurrentVersion" notifyMode="Off" default="Device.DeviceInfo.SoftwareVersion" DataType="string" SaveType="LM" Permissions="7,7"></Element>
<Element Name="X_SCM_LicenseEnable" Writable="1" notifyMode="Off" default="0" DataType="boolean" SaveType="CM" Permissions="1,1"></Element>
<Element Name="ActivateTime" Writable="1" notifyMode="Off" default="0000-00-00T00:00:00" DataType="dateTime" Permissions="5,5"></Element>
<Element Name="ActivateEnable" Writable="1" notifyMode="Off" default="0" DataType="boolean" SaveType="CM" Permissions="5,5"></Element>
</Element>
<Element Name="LogMgmt." DataType="object" Permissions="5,5">
<Element Name="PeriodicUploadEnable" notifyMode="Off" default="Device.DeviceInfo.VendorLogFile.1.X_SCM_LogControl.X_SCM_PeriodicUploadEnable" DataType="string" SaveType="LM" Permissions="5,5"></Element>
<Element Name="URL" notifyMode="Off" default="Device.DeviceInfo.VendorLogFile.1.X_SCM_LogControl.X_SCM_UploadURL" DataType="string(256)" SaveType="LM" Permissions="5,5"></Element>
<Element Name="Username" notifyMode="Off" default="Device.DeviceInfo.VendorLogFile.1.X_SCM_LogControl.X_SCM_Username" DataType="string(256)" SaveType="LM" Permissions="5,5"></Element>
<Element Name="Password" notifyMode="Off" default="Device.DeviceInfo.VendorLogFile.1.X_SCM_LogControl.X_SCM_Password" DataType="string(256)" SaveType="LM" Permissions="5,5"></Element>
<Element Name="PeriodicUploadInterval" notifyMode="Off" default="Device.DeviceInfo.VendorLogFile.1.X_SCM_LogControl.X_SCM_PeriodicUploadInterval" DataType="string" SaveType="LM" Permissions="5,5"></Element>
</Element>
<Element Name="Services." DataType="object" Permissions="5,5">
<Element Name="FAPServiceNumberOfEntries" notifyMode="Off" default="1" DataType="unsignedInt" Permissions="1,1"></Element>
<Element Name="FAPService." DataType="object" Permissions="5,5">
<Element Name="1." DataType="object" Permissions="5,5">
<Element Name="DeviceType" notifyMode="Off" default="Standalone" DataType="string" Permissions="5,5"></Element>
<Element Name="DNPrefix" Writable="1" notifyMode="Off" default="" DataType="string(256)" Permissions="5,5"></Element>
<Element Name="Capabilities." DataType="object" Permissions="5,5">
<Element Name="GPSEquipped" notifyMode="Off" default="0" DataType="boolean" Permissions="5,5"></Element>
<Element Name="MaxTxPower" notifyMode="Off" default="13" DataType="unsignedInt[0:40]" Permissions="5,5"></Element>
<Element Name="X_SCM_MinTxPower" notifyMode="Off" default="-10" DataType="int" Permissions="5,5"></Element>
<Element Name="SupportedSystems" notifyMode="Off" default="LTE" DataType="string" Permissions="5,5"></Element>
<Element Name="LTE." DataType="object" Permissions="3,3">
<Element Name="DuplexMode" notifyMode="Off" default="TDDMode" DataType="string(32)" Permissions="3,3"></Element>
<Element Name="X_SCM_BandWidthsSupported" notifyMode="Off" default="10M,20M" DataType="string(32)" SaveType="SM" Permissions="3,3"></Element>
<Element Name="BandsSupported" notifyMode="Off" default="42,43,48" DataType="string(16)" SaveType="SM" Permissions="3,3"></Element>
<Element Name="NNSFSupported" Writable="1" notifyMode="Off" default="0" DataType="boolean" Permissions="3,3"></Element>
<Element Name="UMTSRxSupported" notifyMode="Off" default="0" DataType="boolean" Permissions="3,3"></Element>
<Element Name="UMTSRxBandsSupported" notifyMode="Off" default="" DataType="string(16)" Permissions="3,3"></Element>
<Element Name="GSMRxSupported" notifyMode="Off" default="0" DataType="boolean" Permissions="3,3"></Element>
<Element Name="GSMRxBandsSupported" notifyMode="Off" default="" DataType="string" Permissions="3,3"></Element>
<Element Name="CDMA2000RxSupported" notifyMode="Off" default="0" DataType="boolean" Permissions="3,3"></Element>
<Element Name="CDMA2000RxBandsSupported" notifyMode="Off" default="" DataType="string(16)" Permissions="3,3"></Element>
<Element Name="UeInactiveTimer" notifyMode="Off" default="Device.Services.FAPService.1.FAPControl.LTE.X_SCM_RRMConfig.X_SCM_InactivityTimerValue" DataType="string" SaveType="LM" Permissions="3,3"></Element>
<Element Name="SupportActiveRRCNumbers" notifyMode="Off" default="Device.Services.FAPService.1.AccessMgmt.LTE.X_SCM_MaxUEsConnected" DataType="string" SaveType="LM" Permissions="3,1"></Element>
</Element>
...
Thanks in advance,
Sam
My Genieacs-CWMP is assigned SSL certificate but I can't use genieacs-sim to register successfully by using the https://ACS_IP:7547.
Did I do something wrong or genieacs-sim can not register by using HTTPS?
My SSL certificate is self signed not by the trust CA.
Thank you for answering.
Mason
I have tried to disable TLS verification, data is injected but it will show device offline while trying to configure. This is the command i have used.
ubuntu@ubuntu:~/genieacs-sim$ NODE_TLS_REJECT_UNAUTHORIZED=0 ./genieacs-sim -u https://192.168.63.4:7547/
Simulator 000000 started
Simulator 000000 listening for connection requests on http://192.168.63.4:49841/
(node:48028) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use node --trace-warnings ...
to show where the warning was created)
And this is the genieacs.env file
ubuntu@ubuntu:~/genieacs-sim$ sudo cat /opt/genieacs/genieacs.env
GENIEACS_CWMP_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-cwmp-access.log
GENIEACS_NBI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-nbi-access.log
GENIEACS_FS_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-fs-access.log
GENIEACS_UI_ACCESS_LOG_FILE=/var/log/genieacs/genieacs-ui-access.log
GENIEACS_DEBUG_FILE=/var/log/genieacs/genieacs-debug.yaml
NODE_OPTIONS=--enable-source-maps
GENIEACS_EXT_DIR=/opt/genieacs/ext
GENIEACS_UI_JWT_SECRET=7b6cd18ac4981d192fdd60284e3e7c5960b5a8d00df226fe69a9a7b1f2f063f4fd397c9f2b5528751f07711592473db26c5adb796a6f0a54ce7c68e093e91d37bfc4ee0d9daad2b9f334a3932f8387dd9946c528137840c83817a0bb1af8b699cdb3a5712ec8affc4bdc34ae9147f3bf8786c6c152cf193d26911db566a4e304
GENIEACS_NBI_SSL_KEY=/opt/genieacs/ssl/genieacs-nbi.key
GENIEACS_NBI_SSL_CERT=/opt/genieacs/ssl/genieacs-nbi.crt
GENIEACS_CWMP_SSL_KEY=/opt/genieacs/ssl/genieacs-cwmp.key
GENIEACS_CWMP_SSL_CERT=/opt/genieacs/ssl/genieacs-cwmp.crt
GENIEACS_FS_SSL_KEY=/opt/genieacs/ssl/genieacs-fs.key
GENIEACS_FS_SSL_CERT=/opt/genieacs/ssl/genieacs-fs.crt
GENIEACS_UI_SSL_KEY=/opt/genieacs/ssl/genieacs-ui.key
GENIEACS_UI_SSL_CERT=/opt/genieacs/ssl/genieacs-ui.crt
GENIEACS_MONGODB_CONNECTION_URL=mongodb://genieacs:[email protected]:27017/genieacs?tls=true&tlsCertificateKeyFile=/opt/genieacs/ssl/mongodb-client.pem&tlsCAFile=/opt/genieacs/ssl/mongodb-server-ca.pem
Line 50 in be391ca
show duplicate default value.
$ ./genieacs-sim --help
Usage: genieacs-sim [options]
TR-069 client simulator for GenieACS
Options:
-V, --version output the version number
-u, --acs-url [url] ACS URL to contact (default: http://127.0.0.1:7547/) (default: "http://127.0.0.1:7547/")
-m, --data-model [filename] Data model template (default: "./data_model_202BC1-BM632w-8KA8WA1151100043.csv")
-p, --processes [count] Number of devices to simulate (default: 1) (default: 1)
-w, --wait [milliseconds] Waiting period between process spawning (default: 1000) (default: 1000)
-s, --serial [offset] Serial number offset (default: 0) (default: 0)
-h, --help output usage information
I am getting this error when stating the app
./genieacs-sim -u http://demo.test.com:8080/ftacs-basic/ACS -s 8KA8WA1151100043 -m data_model_202BC1-BM632w-8KA8WA1151100043.json
Simulator 000NaN started
/genieacs-sim/simulator.js:160
let requestId = xml.get("/soap-env:Envelope/soap-env:Header/cwmp:ID", NAMESPACES).text();
TypeError: Cannot read property 'text' of undefined
at handleMethod /genieacs-sim/simulator.js:160:84)
at /genieacs-sim/simulator.js:128:7
at IncomingMessage. /genieacs-sim/simulator.js:86:14)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1081:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Simulator 000008 died (1). Restarting in 10 seconds..
How to setup genieacs-sim for https genieacs-TR-69 server
Hello Friends,
We are trying to implement GenieACS "download" task API. We are getting below error in UI:-
faultCode: "9003"
faultString: Invalid arguments
setParameterValuesFault: null
Using our tool, we are doing a POST as below:-
URL - http://ACS_IP:7557/devices/A4D4B2-PUMA-012112333/tasks?timeout=3000&connection_request
Body:-
{
"name": "download",
"file": "tr069.xml"
}
Can anyone inform what is the correct usage for "download" API and help us resolve this error.
Thanks in advance,
H
root@fqdn:~/genieacs-sim# ./genieacs-sim
Simulator 000000 started
/root/genieacs-sim/simulator.js:288
if (err) throw err;
^
Error: connect ECONNREFUSED 127.0.0.1:7547
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1133:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 7547
}
Simulator 000000 died (1). Restarting in 10 seconds...
^C
I am getting the following error while running the simulator
sim/node_modules/libxmljs/lib/document.js:169
return bindings.fromXml(string, options||{});
^
Error: Premature end of data in tag html line 2
at Object.module.exports.fromXml (/home/user/abc/sim/node_modules/libxmljs/lib/document.js:169:21)
$ node -v
v7.10.1
$ npm -v
4.2.0
Simulator 000000 started
events.js:183
throw er; // Unhandled 'error' event
^
Error: unable to verify the first certificate
at TLSSocket. (_tls_wrap.js:1105:38)
at emitNone (events.js:106:13)
at TLSSocket.emit (events.js:208:7)
at TLSSocket._finishInit (_tls_wrap.js:639:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:469:38)
Simulator 000000 died (1). Restarting in 10 seconds..
Hi,
Is there any way to change the inform event to BOOTSTRAP and add security (User a Pass) for authentication?
Thanks.
/home/ubuntu/genieacs-sim/simulator.js:288
if (err) throw err;
^
Error: connect ECONNREFUSED 127.0.0.1:7547
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)
Simulator 000000 died (1). Restarting in 10 seconds...
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.