0.1.11 • Published 5 years ago

raspberry_pi_config v0.1.11

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

What is this Module

Some function to configuration the PI

Usage

Some samples to use this Module

Require Module

const pi = require("./pi");

Test Get function

async function testSet() {
	const mess = await pi.NTPstate.set("1");
	await pi.NTPip.set("192.168.180.48");   
	console.log("output: "+mess);

	await pi.Timezone.set("Europe/Berlin");
	await pi.PiDate.set("2019-01-01");
	await pi.Time.set("01:02:03"); 
}  
testSet();

Test Set function

async function testGet() {
	const state = await pi.NTPstate.get();
	const zone = await pi.Timezone.get();
	const newdate = await pi.PiDate.get();
	const time = await pi.Time.get();
	const ip = await pi.NTPip.get();
	const st = await pi.SummerTime.get();
	
	console.log("state: "+state);
	console.log("zone: "+zone);
	console.log("pidate: "+newdate);
	console.log("time: "+time);
	console.log("ip: "+ip);
	console.log("st begann: "+st.begann);
	console.log("st end: "+st.end);
	console.log("st DatePi: "+st.piDate);
	console.log("st state: "+st.state);
}
testGet();

Test Get function 2

async function testGet2() {
	const state = await pi.DHCP.get();
	const zone = await pi.Timezone.get();

	const newdate = await pi.PiDate.get();
	const time = await pi.Time.get();

	const ip = await pi.NTPip.get();
	const st = await pi.SummerTime.get();
    
	console.log("state: "+state);
	console.log("zone: "+zone);
    
	console.log("pidate: "+newdate);
	console.log("time: "+time);
	console.log("ip: "+ip);

	console.log("st begann: "+st.begann);
	console.log("st end: "+st.end);
	console.log("st DatePi: "+st.piDate);
	console.log("st state: "+st.state);
}
    
testGet2();
0.1.11

5 years ago