Akshay Bhavsar

Forum Replies Created

Viewing 24 posts - 1 through 24 (of 24 total)
  • Author
    Posts
  • in reply to: how to make node-red app accessible to customer #17473
    Akshay Bhavsar
    Participant

    Hey Peter,

    I could access my web application without even login to conduit and node-red, but when I restart the conduit, I have to wait about 7-10 minutes to access web-application, until then it shows this error as mentioned before.

    Why it is taking such a long time ?

    https://drive.google.com/file/d/0B8vP1Z3v0Sw8T3cwcGtKNy1NQ2c/view

    Thanks

    in reply to: how to make node-red app accessible to customer #17469
    Akshay Bhavsar
    Participant

    Thanks for your help Peter.. Appreciated it.. Just one more question, how can I remotely access conduit, make changes and would be able to deploy the code ?

    in reply to: how to make node-red app accessible to customer #17468
    Akshay Bhavsar
    Participant

    ok thanks..What I have notice strange thing is that, after importing a flow you mentioned and running that, my flow also started to working even without login into node-red.

    in reply to: how to make node-red app accessible to customer #17466
    Akshay Bhavsar
    Participant

    /home/root/data.txt , how can I make this file to readable by everyone ?

    in reply to: how to make node-red app accessible to customer #17456
    Akshay Bhavsar
    Participant

    Here is the flow.

    [{"id":"8ed4b335.cac8a","type":"file","name":"","filename":"/home/root/data.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","x":687.9999885559082,"y":192,"z":"c8f27500.54b3f8","wires":[]},{"id":"1a0f0418.0a73fc","type":"template","name":"","field":"","format":"handlebars","template":"<pre>{{payload}}</pre>","x":741,"y":434,"z":"c8f27500.54b3f8","wires":[["7a2e6c25.ac6cb4"]]},{"id":"7a2e6c25.ac6cb4","type":"http response","name":"","x":920.9999885559082,"y":430.9999542236328,"z":"c8f27500.54b3f8","wires":[]},{"id":"5446f213.d50c2c","type":"http in","name":"","url":"/test","method":"get","swaggerDoc":"","x":270,"y":433.99993896484375,"z":"c8f27500.54b3f8","wires":[["403ed356.16ea8c"]]},{"id":"c327ffe5.3525d","type":"debug","name":"","active":false,"console":"false","complete":"payload","x":706,"y":349.99993896484375,"z":"c8f27500.54b3f8","wires":[]},{"id":"403ed356.16ea8c","type":"file in","name":"","filename":"/home/root/data.txt","format":"utf8","x":498,"y":433.99993896484375,"z":"c8f27500.54b3f8","wires":[["c327ffe5.3525d","1a0f0418.0a73fc"]]},{"id":"a29775ea.2a1308","type":"lora in","name":"","datatype":"bytes","x":299.799991607666,"y":190.1999969482422,"z":"c8f27500.54b3f8","wires":[["aa0885d9.f41798"]]},{"id":"aa0885d9.f41798","type":"function","name":"","func":"var identify_button = ((msg.payload).slice((msg.payload.length)-10,(msg.payload.length)-9));\nvar rBuf_identify_button = new Buffer(identify_button,'hex');\nvar identify_button_val = (rBuf_identify_button.readUInt8(0));\nvar time = msg.timestamp;\nvar ID_tag = msg.eui;\n\nvar button_status;\nvar identify_button_val_remainder = (identify_button_val)%64;\nif(identify_button_val_remainder == 14)\n{\n button_status = \"pressed\";\n}\nelse\n{\n button_status = \"Not-pressed\"; \n}\n\nvar battery = ((msg.payload).slice((msg.payload.length)-9,(msg.payload.length)-8));\nvar rBuf_battery = new Buffer(battery,'hex');\nvar battery_val = (rBuf_battery.readInt8(0));\n\nvar latitude = ((msg.payload).slice((msg.payload.length)-8,(msg.payload.length)-4));\nvar rBuf_latitude = new Buffer(latitude,'hex');\nvar latitude_val = (rBuf_latitude.readInt32BE(0))*0.000001;\n\nvar longitude = ((msg.payload).slice((msg.payload.length)-4,msg.payload.length));\nvar rBuf_longitude = new Buffer(longitude,'hex');\nvar longitude_val = (rBuf_longitude.readInt32BE(0))*0.000001;\n\nmsg.payload = {payload: \"time: \" +time+ \", \" + \"ID tag: \" +ID_tag+ \", \" + \"Button: \"+ button_status+ \", \" +\"Battery status: \" + battery_val + \"%, \" + \"GPS Data: \" + latitude_val + \",\" + longitude_val };\n\nreturn msg.payload;\n\n","outputs":1,"noerr":0,"x":480.8000068664551,"y":192.20001220703125,"z":"c8f27500.54b3f8","wires":[["8ed4b335.cac8a","d8e03144.1d9eb"]]},{"id":"d8e03144.1d9eb","type":"debug","name":"","active":false,"console":"false","complete":"payload","x":654.7999725341797,"y":111.19999694824219,"z":"c8f27500.54b3f8","wires":[]}]

    I have tried the flow you mentioned, I can access that one even without login in to node-red. I am not sure what is the problem with my flow.

    Thanks

    in reply to: how to make node-red app accessible to customer #17451
    Akshay Bhavsar
    Participant

    I do use http request and response node. Have a look attached flow for confirmation.

    https://drive.google.com/open?id=0B8vP1Z3v0Sw8cFNwZGpZNDAzSnc

    When I try to run https://192.168.2.1:1880/test without login to node-red, I see error page.

    https://drive.google.com/file/d/0B8vP1Z3v0Sw8T3cwcGtKNy1NQ2c/view

    in reply to: how to make node-red app accessible to customer #17447
    Akshay Bhavsar
    Participant

    Can anyone please explain this how to solve this scenario with more concrete example ?

    Thanks

    in reply to: how to make node-red app accessible to customer #17402
    Akshay Bhavsar
    Participant

    What I want to exactly do is like if I give my conduit to other person, then he should be able to access web-page app directly ( by just going to https://192.168.2.1:1880/test), without even login to conduit and node-red. How can I do this ?

    Another question is if any problem occurs then, I should be able to fix it remotely by accessing node-red and GUI of Multitech conduit. So, how could I access multitech conduit remotely without using Simcard.

    Any help would be great !

    Thanks

    in reply to: how to make node-red app accessible to customer #17395
    Akshay Bhavsar
    Participant

    Thanks for your help Jeff. Is it possible to access webpage directly without even login to Node-RED page ?

    in reply to: Node-red Convert Hex number into signed floating number #17145
    Akshay Bhavsar
    Participant

    Hi there,

    I have solved this by using following command.

    var battery = ((msg.payload).slice((msg.payload.length)-9,(msg.payload.length)-8));
    var rBuf_battery = new Buffer(battery,'hex');
    var battery_val = (rBuf_battery.readInt8(0));

    readInt8(0) function can be readUInt8(0) for unsigned number. Also depending the length of hex number this function can also be write as readInt16(0) and readInt32(0).

    Thanks

    in reply to: Node-red Convert Hex number into signed floating number #16843
    Akshay Bhavsar
    Participant

    Hi Peter,

    Have you find anything ?

    Thanks
    Akshay

    in reply to: Node-red Convert Hex number into signed floating number #16835
    Akshay Bhavsar
    Participant

    The output of debug node, without the function is as follow

    00820dfdbd803008a08856

    I want to slice 4 hex number at the end and convert it into decimal.
    I just found that slice doesn’t written data type in hex. If I just assign hard value of hex number as
    var a = 0xfb5216ff

    It does convert into number by using parseInt command.

    in reply to: Node-red Convert Hex number into signed floating number #16829
    Akshay Bhavsar
    Participant

    Here is the flow

    var longitude= ((msg.payload).slice((msg.payload.length)-4,msg.payload.length));
    longitude = parseInt(longitude,16);
    return longitude;

    https://drive.google.com/open?id=0B8vP1Z3v0Sw8NHpvZ2ZlUGZVOXM

    in reply to: Node-red Convert Hex number into signed floating number #16826
    Akshay Bhavsar
    Participant

    It is in byte mode, but doesn’t give me any data. Is there any alternative ?

    in reply to: Cannot receive data send by MTDOT-BOX-G-915 on Node-RED #16689
    Akshay Bhavsar
    Participant

    Thanks Guys, I have found out the problem.

    MTDOT-BOX was configured wrong. The data rate was DR0 and max payload was 100, so I set up data rate to DR4 and max payload to 242. So, I am getting payload in both applications LoRa Demo and survey signal.

    following link has command for it. if anyone find same problem.
    http://www.multitech.net/developer/software/dot-box-and-evb-software/configuration-mode/

    in reply to: Cannot receive data send by MTDOT-BOX-G-915 on Node-RED #16682
    Akshay Bhavsar
    Participant

    Is there any updates on this issue ?

    in reply to: Internet connection on conduit AEP using Ethernet cable #16681
    Akshay Bhavsar
    Participant

    Thanks jeff

    in reply to: Internet connection on conduit AEP using Ethernet cable #16648
    Akshay Bhavsar
    Participant

    Thanks Jeff,

    I am not going to use cellular same time , but can I use it as one of internet connection might have drop or other problem, just as a backup ?

    in reply to: Node-red #16625
    Akshay Bhavsar
    Participant
    in reply to: Node-red #16624
    Akshay Bhavsar
    Participant

    in reply to: Node-red #16623
    Akshay Bhavsar
    Participant

    Hi Steve,

    I did that, but not able to see anything on debug tab. It does join and I can see in statics. Have a look the image.

    in reply to: Node-red #16621
    Akshay Bhavsar
    Participant

    Hi Steve,

    Is there any updates on this or the code you have provided might have something wrong in it. MTDOT-BOX-G-195 do join conduit box. When I run IP address of conduit box and check system log and under the LoRa tab it does shows the connection. I have used your code( as mentioned above thread) in Node-RED and send data from MTDOT-BOX, but do not able to see that in debug window.

    Your help would be great.

    Thanks
    Akshay

    in reply to: Node-red #16610
    Akshay Bhavsar
    Participant

    Hi guys,
    Don’t worry about the above error, I figure it out.

    Now the problem is I am note able to receive data on debug window of Node-RED. I am successfully able to join MTDOT-Box-G-915 to MultiConnect Conduit. When I run LoRa Demo from theMTDOT-Box-G-915 and send the the data not able to receive it on Node-RED.

    I have imported the code as @Steve Kovarik has suggested.

    So, What can be the issue ?

    Thanks
    Akshay

    in reply to: Node-red #16607
    Akshay Bhavsar
    Participant

    @Leon I know the link, but there isn’t any full example for it, such as assigning data type and stuff.

    var data_type = {
    	none : 0x00,
    	led1 : 0x01,
    	led2 : 0x02,
    	lux_max : 0x03,
    	lux_min : 0x04,
    	lux_curr : 0x05,
    	baro_max : 0x06,
    	baro_min : 0x07,
    	baro_curr : 0x08,
    	temp_max : 0x09,
    	temp__min : 0x0A,
    	temp_curr : 0x0B,
    	accel_max : 0x0C,
    	accel_min : 0x0D,
    	accel_curr : 0x0E,
    	configuration : 0x0F,
    	gpio_in : 0x10,
    	gpio_out : 0x11,
    	current_max : 0x12,
    	current_min : 0x13,
    	current_curr : 0x14,
    	gps_latitude : 0x15,
    	gps_longitude : 0x16,
    	gps_time : 0x17,
    	gps_date : 0x18,
    	gps_lock : 0x19,
    	qos_up : 0x1A,
    	qos_dwn : 0x1B,
    	rf_out : 0x1C,
    	data_mark : 0x1D,
    };
    
    var data_struc = {
    	data_valid : 0,
    	block_start :0,
    	temperature : 0,
    	x_pos : 0,
    	y_pos : 0,
    	z_pos : 0,
    	baro_pressure : 0,
    	lux : 0,
    	pkt_timer :0,
    	rf_pwr : 0,
    	sf_val : 0,
    	rssi_up : 0,
    	snr_up : 0,
    	rssi_dwn : 0,
    	snr_dwn :0 ,
    	lat_deg : 0 ,
    	lat_min : 0,
    	long_deg : 0,
    	long_min : 0,
    	num_sats : 0 ,
    	gps_status : 0,
    };
    
    context.global.data_out = context.global.data_out || data_struc;
    var pData = context.global.data_out;
    
    var msg_pntr = 0;
    var temp = 0;
    
    while (msg_pntr < msg.payload.length){
    	switch (msg.payload[msg_pntr]){
    	case data_type.lux_max:
    	case data_type.lux_min:
    	case data_type.lux_curr:
    		pData.lux = msg.payload[++msg_pntr] << 8;
    		pData.lux |= msg.payload[++msg_pntr];
    		pData.lux = pData.lux * 0.24;
    		msg_pntr++;
    		break;
    	case data_type.baro_max:
    	case data_type.baro_min:
    	case data_type.baro_curr:
    		pData.baro_pressure = msg.payload[++msg_pntr]<<16;
    		pData.baro_pressure |= msg.payload[++msg_pntr]<<8;
    		pData.baro_pressure |= msg.payload[++msg_pntr];
    		pData.baro_pressure = pData.baro_pressure * 0.25;
    		msg_pntr++;
    		break;
    	case data_type.accel_max:
    	case data_type.accel_min:
    	case data_type.accel_curr:
    		pData.x_pos = ((msg.payload[++msg_pntr] << 24) >> 24) * 0.0625;
    		pData.y_pos = ((msg.payload[++msg_pntr] << 24) >> 24) * 0.0625;
    		pData.z_pos = ((msg.payload[++msg_pntr] << 24) >> 24) * 0.0625;
    		msg_pntr++;
    		break;
    	case data_type.temp_min:
    	case data_type.temp_max:
    	case data_type.temp_curr:
    		pData.temperature = msg.payload[++msg_pntr] << 24;
    		pData.temperature |= msg.payload[++msg_pntr] << 16;
    		pData.temperature = (pData.temperature >> 16) * 0.0625;
    		msg_pntr++;
    		break;
    	case data_type.configuration:
    		pData.pkt_timer = msg.payload[++msg_pntr];
    		msg_pntr++;
    		break;
    	case data_type.current_max:
    	case data_type.current_min:
    	case data_type.current_curr:
    		msg_pntr++;
    		msg_pntr++;
    		msg_pntr++;
    		break;
    	case data_type.gps_latitude:
    		pData.lat_deg = (msg.payload[++msg_pntr] << 24) >> 24;
    		pData.lat_min = msg.payload[++msg_pntr];
    		temp = msg.payload[++msg_pntr] << 8 ;
    		temp |= msg.payload[++msg_pntr];
    		pData.lat_min = pData.lat_min + (temp * 0.0001);
    		msg_pntr++;
    		break;
    	case data_type.gps_longitude:
    		pData.long_deg = (msg.payload[++msg_pntr] << 24);
    		pData.long_deg |= (msg.payload[++msg_pntr] << 16);
    		pData.long_deg = pData.long_deg >> 16;
    		pData.long_min = msg.payload[++msg_pntr];
    		temp = msg.payload[++msg_pntr] << 8;
    		temp |= msg.payload[++msg_pntr];
    		pData.long_min = pData.long_min + (temp * 0.0001);
    		msg_pntr++;
    		break;
    	case data_type.gps_time:
    		msg_pntr++;
    		msg_pntr++;
    		msg_pntr++;
    		msg_pntr++;
    		break;
    	case data_type.gps_date:
    		msg_pntr++;
    		msg_pntr++;
    		msg_pntr++;
    		msg_pntr++;
    		break;
    	case data_type.gps_lock:
    		msg_pntr++;
    		pData.gps_status = msg.payload[msg_pntr] & 0x0F;
    		pData.num_sats = msg.payload[msg_pntr++] >> 4;
    		break;
    	case data_type.qos_up:
    		pData.rssi_up = msg.payload[++msg_pntr] << 24;
    		pData.rssi_up |= msg.payload[++msg_pntr] << 16;
    		pData.rssi_up = pData.rssi_up >> 16;
    		pData.snr_up = (msg.payload[++msg_pntr] << 24) >> 24;
    		pData.rf_pwr = (msg.payload[++msg_pntr] << 24) >> 24;
    		msg_pntr++;
    		break;
    	case data_type.qos_dwn:
    		pData.rssi_dwn = msg.payload[++msg_pntr] << 24;
    		pData.rssi_dwn |= msg.payload[++msg_pntr] << 16;
    		pData.rssi_dwn = pData.rssi_dwn >> 16;
    		pData.snr_dwn = ((msg.payload[++msg_pntr] << 24) >> 24) / 4;
    		msg_pntr++;
    		break;
    	case data_type.rf_out:
    		pData.rf_pwr = (msg.payload[++msg_pntr] << 24) >> 24;
    		msg_pntr++;
    		break;
    	case data_type.data_mark:
    		if (msg_pntr == '0') {
    			pData = data_struc;
    			pData.block_start = 1;
    			msg_pntr++;
    		}
    		else if (msg_pntr == (msg.payload.length - 1) && (pData.block_start === 1)) {
    				pData.data_valid = 1;
    				msg_pntr++;
    			}
    			else {
    				pData = data_struc;
    				msg_pntr = msg.payload.length;
    				}
    		break;
    	default:
    		pData = data_struc;
    		msg_pntr = msg.payload.length;
    	}
    }
    
    pData.sf_val = parseInt(msg.datr.replace("SF","  "),10);
    
    context.global.data_out = pData;
    
    return pData;
    

    @steve Thanks man. It has created above code, but still I am not able to see data on Node-RED at debug window.

    When I deploy I am getting following error, what that means and how can I correct it ?

    ” mqtt-broker: staging.thethingsnetwork.org:1883 ”

    Thanks guys
    Akshay

Viewing 24 posts - 1 through 24 (of 24 total)