Forum Replies Created
-
AuthorPosts
-
Got Xbee Sleep access fixed.
I’m now communicating to the Xbee Wifi and getting NIST time.
Looks like an error on post.Fixed the Xbee Sleep access;
envirodiy\ModularSensors\src\ModemOnOff.cGot Xbee Sleep access fixed.
I’m now communicating to the Xbee Wifi and getting NIST time.
Looks like an error on post.Fixed the Xbee Sleep access;
envirodiy\ModularSensors\src\ModemOnOff.cpp
bool heldOnOff::on(void)
//digitalWrite(_modemSleepRqPin, HIGH);
digitalWrite(_modemSleepRqPin,_isHighWhenOn) ;bool heldOnOff::off(void)
//digitalWrite(_modemSleepRqPin, LOW);
digitalWrite(_modemSleepRqPin,!_isHighWhenOn);<start log of post>
\/—- Post Request to EnviroDIY —-\/
POST /api/data-stream/ HTTP/1.1
Host: data.envirodiy.org
TOKEN: 7b19191b-b3d6-416d-9e07-4fbe549f2493
Content-Length: 334
Content-Type: application/json{“sampling_feature”: “b918f150-4fff-424d-813a-a69a808a93b6”, “timestamp”: “2018-10-09T16:58:00-08:00”, “3907922a-56fe-46f3-a56e-9de6b77d3679”: 23.50, “f40a9dff-2c54-43ae-a016-1c5095c188eb”: 0.0323, “7bc30855-ae08-4865-ab89-a8e17df93bfc”: 19.24, “2c58e64d-6b66-4d9e-b893-bfdb10b65426”: 4.457, “0cf94fc8-a5d2-4fbe-82f2-2a81650575a8 “: 0}
[26306] ### Unhandled: r: nginx/1.10.3 (Ubuntu)
Date: Wed, 10 Oct 2018 00:58:14 GMT
th: 78
Connection: keep-alive
Vary: Accept
X-Frame-Options: SAMEORIGIN
Allow: POST, OPTIONS
{“detail”:”JSON parse error – Expecting object: line 1 column 334 (char 333)”}HTTP/1.1 400 Bad Request
Server: n
Hi @srgdamiano, Thanks for the headsup on new enviroDIY/TinyGSM release. I can see init changes on https://github.com/EnviroDIY/TinyGSM/branchesI did start with Mayfly setup:
const char *wifiId =Hi @srgdamiano, Thanks for the headsup on new enviroDIY/TinyGSM release. I can see init changes on https://github.com/EnviroDIY/TinyGSM/branchesI did start with Mayfly setup:
const char *wifiId = “MyGuest”; // The WiFi access point, unnecessary for gprs
const char *wifiPwd = “”; // The password for connecting to WiFi, unnecessary for gprs
const long ModemBaud = 9600; // Default for XBee is 9600, I’ve sped mine up to 57600
const int8_t modemSleepRqPin = 23;//23; // Modem SleepRq Pin (for sleep requests) (-1 if unconnected)
const int8_t modemStatusPin = 19;//BEECTS;//19; // Modem Status Pin (indicates power status) (-1 if unconnected)
const int8_t modemVCCPin = -1; // Modem power pin, if it can be turned on or off (-1 if unconnected)
ModemSleepType ModemSleepMode = modem_sleep_reverse; // How the modem is put to sleepand thats when it initialized and then hung. XCTU showed MyGuest, Encryption Enable, PK Passphrase empty (which it always shows as empty, it seems its a write only field for pwds!).
So connecting a logic analyzer on XbeeWifi pins the modemSleepRqPin wasn’t requesting wake state and sending data to a sleeping Xbee – so after about 3hrs of tracing input to the XbeeWifi module I figured I was getting it wrong.So checking the updates pending on EnviroDIY/TinyGSM I figure I should use your new release (thanks for all the updates to vshymanskyy/TinyGSM) and then try again.
So to try again with the Mayfly, I think should
1) Reset the XBEE WiFi module to defaults via XCTU
2) Set “logging_to_EnviroDIY.ino” to sleep mode as above and then Monitor the modemSleepRqPin and modemStatusPin and Tx & Rx
and see if it works.I can go onto a different project until the new EnviroDIY/TinyGSM lib is released.
Alternatively, if it would be useful to you, I could attempt a pre – release build of enviroDIY/TinyGSM (master or original?).Here is my current log
<start log with pins enabled, and WiFi configured********************************>
Now running logging_to_EnviroDIY.ino on Logger nh06c
Logger timezone is UTC-8
RTC timezone is UTC
Creating a new on/off method for the Digi XBee with power on pin -1 status on pin 19 and on/off by holding pin 23 low.
Creating a new TinyGSM modem and client for the Digi XBee…
Initializing Digi XBee…
[1863] ### Modem: Digi XBee® Wi-Fi
… Complete!
Modem attached!
Pin 8 set as LED alert pin
Pin 21 set as testing mode entry pin
Registration token set!
Sampling feature UUID set!
Current RTC time is: 2000-01-06T11:00:22-08:00
Setting up logger nh06c to record at 10 minute intervals.
This logger has a variable array with 7 variables, of which 7 come from 4 sensors and 0 are calculated.
Successfully connected to SD Card with card/slave select on pin 12
Opened existing file: nh06c_2000-01-06.csv
Data will be saved as nh06c_2000-01-06.csv
This logger is also tied to a NO MODEM SELECTED for internet connectivity.
Turning modem on.
Skipping modem in sensor power up!
Skipping modem in sensor power down!
Attempting to synchronize RTC with NIST
This may take up to two minutes!Waiting up to 5 seconds for modem to respond to AT commands…
Modem does not respond to AT commands!
Turning modem off.
Clock interrupt!
Push button on pin 21 at any time to enter sensor testing mode.
Logger setup finished!
——————————————Cloÿ,HZ·terrupt!
Clock interrupt!
Current Unix Timestamp: 947156460
Logging interval in seconds: 600
Mod of Logging Interval: 60
Number of Readings so far: 0
Mod of 120: 60
Not time yet.Just wondering is anybody is using the Digi Xbee S6 module.
I’m trying it as my first test module
I have an open guest wifi that I’ve used.
It initialled configured it -.
const char *wifiJust wondering is anybody is using the Digi Xbee S6 module.
I’m trying it as my first test module
I have an open guest wifi that I’ve used.
It initialled configured it -.
const char *wifiId = “MyGuest”; // The WiFi access point, unnecessary for gprs
const char *wifiPwd = “”; // The password for connecting to WiFi, unnecessary for gprs
It powered up, and didn’t appear to work.
So enabled logging that I could find.
it became all strange..
I put it on XCTU/XBIB to read it and could see it did the WiFiID – but then it started behaving strangely
So I’ve changed to this
#if defined(TINY_GSM_MODEM_XBEE)
const long ModemBaud = 9600; // Default for XBee is 9600, I’ve sped mine up to 57600
const int8_t modemSleepRqPin = -1;//23; // Modem SleepRq Pin (for sleep requests) (-1 if unconnected)
const int8_t modemStatusPin = -1;//BEECTS;//19; // Modem Status Pin (indicates power status) (-1 if unconnected)
const int8_t modemVCCPin = -1; // Modem power pin, if it can be turned on or off (-1 if unconnected)
ModemSleepType ModemSleepMode = modem_sleep_reverse; // How the modem is put to sleepand from reset I get the following
with the last two sets of commands goign to the XBEE WiFi
ATAC\r response OK\r
ATHS\r 601\r
ATCN\r OK\r
then
+++ response OK\r
ATS1\r OK\r
ATS0200\r OK\r
ATWR\r OK\r
ATAC\r OK\r
ATCN\r OK\r
then nothing ….
It looks like it looses or is reinitialized from knowing its an XBEE Wifi
Any suggestions on how to configure Xbee WiFi. I haven’t worked through the AT cmd set as I think I’m doing something wrong 🙁—————-The terminal output from reset—
Now running logging_to_EnviroDIY.ino on Logger nh06b
Logger timezone is UTC-8
RTC timezone is UTC
Creating a new on/off method for the Digi XBee with power on pin -1 status on pin -1 and on/off by holding pin -1 low.
Creating a new TinyGSM modem and client for the Digi XBee…
Initializing Digi XBee…
[1863] ### Modem: Digi XBee® Wi-Fi
… Complete!
Modem attached!
Pin 8 set as LED alert pin
Pin 21 set as testing mode entry pin
Registration token set!
Sampling feature UUID set!
Current RTC time is: 2000-01-02T18:01:54-08:00
Setting up logger nh06b to record at 10 minute intervals.
This logger has a variable array with 7 variables, of which 7 come from 4 sensors and 0 are calculated.
Successfully connected to SD Card with card/slave select on pin 12
Opened existing file: nh06b_2000-01-02.csv
Data will be saved as nh06b_2000-01-02.csv
This logger is also tied to a NO MODEM SELECTED for internet connectivity.
Turning modem on.
Skipping modem in sensor power up!
Skipping modem in sensor power down!
Attempting to synchronize RTC with NIST
This may take up to two minutes!Waiting up to 5 seconds for modem to respond to AT commands…
Modem does not respond to AT commands!
Turning modem off.
Push button on pin 21 at any time to enter sensor testing mode.
Logger setup finished!
——————————————Current Unix Timestamp: 946836120
Logging interval in seconds: 600
Mod of Logging Interval: 120
Number of Readings so far: 0
Mod of 120: 0
Time marked at (unix): 946836120
year: 2000
month: 1
date: 2
hour: 18
minute: 2
second: 0
Time marked at [char]: 2000-01-02T18:02:00-08:00
Time to log!Had this come through –
https://www.crowdsupply.com/silicognition/wesp32 – POE ESP supposedly first delivery mid-Dec
https://github.com/espressif/arduino-esp32 No idea how well an ArduiHad this come through –
https://www.crowdsupply.com/silicognition/wesp32 – POE ESP supposedly first delivery mid-Dec
https://github.com/espressif/arduino-esp32 No idea how well an Arduino XBP900 interface would work with this.I personally have found PoE 802.15af has worked very well for “borrowing” some space on some other entities building.
It has meant a long drill for going through an insulated wall, and physical access to the network somewhere in the building. Building maintenance is used to being helpful. It has been easier than IT WiFi access that is nervous about network breaches, and changing passwords.Hi @srgdamiano –SensorBase Class – I’m a C guy trying for some class – but I’ll take the power switching where ever those in the higher classes deem it 🙂 Let me know
Hi @srgdamiano –SensorBase Class – I’m a C guy trying for some class – but I’ll take the power switching where ever those in the higher classes deem it 🙂 Let me know where I could pull from when its available.
I hear you about AltSoftSerial – I got a gray hair just thinking about it – but its the way RS485 wingboard plugs into the Mayfly and so far its worked. It seems awfully dependent on playing nice with interrupts.
Now there is such good software available – if the AltSoftSerial fails I’ll have to think of a hardware solution – possibly moving the RS485 from connector J4 to J3….. but even then start to get into limitations with serial ports – one is needed for debug and one is needed for XBEE .
Oh well the world of Arm with 4+ serial ports is in another universe – I have my favourite MKL27Z256 – builtin USB, RTC, ADC16bit, 32Ksram – and costs same mega1284. Same family as TeensyLC, but has ROM bootloader like mega1284. I have one running on another board – Oh well.!!Thanks for the headsup on LTE-M – good to hear that some people have it working with Hologram network – I understand from another project that I’m on that LTE-M’s coverage is extending. I haven’t found a map yet of coverage – but will keep ears open.
I imagine you know about the 2G network changes https://www.envirodiy.org/wild-wireless-world-2g-or-3g/Hi
I’m running into a low power issue with the sensors/RS485 turned off.
There is a backfeed going on, which leaves SW_3.3V at about 2V and LED3 comes on.I think @aufdenkampe gave me a hin
Hi
I’m running into a low power issue with the sensors/RS485 turned off.
There is a backfeed going on, which leaves SW_3.3V at about 2V and LED3 comes on.I think @aufdenkampe gave me a hint of this and described a solution
https://github.com/EnviroDIY/ModularSensors/issues/140 in discussion with @srgdamianoHowever I can’t find it in the release I have – and I’m not sure I understand if @aufdenkampe solution in 140 is releasable since its in LoggerEnviroDIY.cpp
That is the RS485 serial port enable bits have to follow the SW_3V3 as is turned on/off.
Seems to me this should happen in the sensor power up and down for the ModbusParent? – though I haven’t been able to find where power up/down is implemented yet. Perhaps I haven’t dug deep enough
So modbusParent power up would be
// Restart the stream for the modbus sensors, because we set pins LOW, below
modbusSerial.begin(9600);and modbusParent power down
// Reset AltSoftSerial pins to LOW, to reduce power bleed on sleep,
// because Modbus Stop bit leaves these pins HIGH
digitalWrite(5, LOW); // Reset AltSoftSerial Tx pin to LOW
digitalWrite(6, LOW); // Reset AltSoftSerial Rx pin to LOWThe issues are closed – so would they be migrated into the main ?
https://github.com/EnviroDIY/ModularSensors/issues/140
https://github.com/EnviroDIY/ModularSensors/issues/148 same issue @fisherba
many thanks for insights.Wow – nice Shannon,
I was wondering @shicks do you have any references to the XBP900 driver code on the mayfly. Since you’ve put the infrastructure in place be nice to have a starting poiWow – nice Shannon,
I was wondering @shicks do you have any references to the XBP900 driver code on the mayfly. Since you’ve put the infrastructure in place be nice to have a starting point :). Thanks for the reference to the Uno. Interesting what you can do on an Uno.
Same observation about 2.4GHz in a forest – the 2.4G gets absorbed by water – ie leaves.
I used two XBP900 in a point-2-multipoint with an Lantronix XPORT AR, that delivered the UART serial data to a destination port – that was then processed into a mysql record.The wire protocol used a TinyOS packet structure which could support a mesh. For a mesh the power usage and network maintenance considerations get more complicated.
The multi-point was a “gateway” that was at buildings that had power and internet access. So from the building antenna position the Line Of Sight for a standard XBP-900HP is about 9miles in a radius from that point – and can support 16bit addressing (65K) end point nodes.
In one location there was a slight ground hump in the way and it was on the edge of the range. I made sure the RSSI was part of the reported signal to be able to monitor it.
There are websites out there that can analyze elevation profile between two points to determine if there is an LOS.Now-days I’m looking at a PocketBeagle with a Ethernet module and POE splitter
PocketBeagle-SC-569
MIKROE-971Attachments:
Hi Dave @dartmouthwsn
Yes I’ve been thinking about it, and I have used the XBP900s before.
Do you see that it would gateway to a) building with internet and power, or b) would it be a gateway tHi Dave @dartmouthwsn
Yes I’ve been thinking about it, and I have used the XBP900s before.
Do you see that it would gateway to a) building with internet and power, or b) would it be a gateway to a cellular service?I just did a long post about this – but then when I completed I have been logged out somehow the post was lost. ouch.
Will try and reconstruct the post but got to get some other things done.
NeilInteresting – I would treat the logging the SD as just a step on the way to having it registered on the remote site database/cloud – whatever the transmission method.
I’ve done it inInteresting – I would treat the logging the SD as just a step on the way to having it registered on the remote site database/cloud – whatever the transmission method.
I’ve done it in the past on a serial SPI flash, with two pointers, one for the next log sample and then a following pointer for what was last
ACKed remotely. It works because its direct access on the serial flash – not a file. This also allowed a UDP type packet in a mesh XPB 900Mhz networkSince ram is likely to be a limitation, and persistent storage is SD card, I would think it needs be stored on the SD card.
For an SD, maybe a way would be if the sensor reading transmission isn’t successful (ie never attempted, or not ACKed from the remote site) for whatever reason, its stored in a separate SD file <reading_staged.json> .
The logging happens as per defined schedule. The wireless connection also has an algorithm for connection attempts. (ie attempt connect every 4th logging interval, or every 24hrs, AND only if there is adequate power [battery voltage] -so makes extended solar loss more manageable)
Then when a connection attempt to the remote site is successful, if the file <reading_staged.json> exists, the current reading is written on to the end of the file. Then renamed to <reading_upload.json> and transmitted sequentially from the file.
If the connection is lost halfway through, then any undelivered records are written to <reading_staged.json>, and delete <reading_upload.json>.
Just an idea.What I’ve also found useful is a <record_num>, and that has enabled me visually audit on the cloud database to see if there are missing records.
Well easy to have ideas. Still working my way through.
I get the Digi WiFi XB2B-WFWT-001 and the new Digi CAT-M1 XB3-C-A2-UT-001 Xbees on Thursday. THe Cat-M1 is very exciting from the power point of view as its designed for data delivery and faster to connect to the cell power from power off.Cheers
Hi @srgdamiano – wonderful to work through the code. Very readable and nicely laid out. Very nice to step through the classes. I’m mostly used C, TinyOS/nesC, Python and now JS. But greatHi @srgdamiano – wonderful to work through the code. Very readable and nicely laid out. Very nice to step through the classes. I’m mostly used C, TinyOS/nesC, Python and now JS. But great to see realtime cpp -all on mega1284 device!!!DEBUGGING: that was what I was looking for. after seeing a line in the macro file I was guessing some trick out there… now I see in KellerParent.h
// #define DEBUGGING_SERIAL_OUTPUT Serial
// #define DEEP_DEBUGGING_SERIAL_OUTPUT Serial
#include “ModSensorDebugger.h”So a general question – it looks like when it comes time to start sensor reading,
there is no opportunity to say connect to the cloud after every Xth sample or after 4hrs ?
Typically I’ve seen with 3G modems that it spends 1minute at high current (0.7A) finding the tower and setting up the tcp link. Then the data is pushed fast and closes down.
So just wondering about that.Also wondering if a wireless connection fails, is there a fall back method for pushing the readings later.
I have had some sites in the past that did not connect for two weeks as they are on the edge of the zone, and it gets a cloudy for two weeks and no RF. -
AuthorPosts