|
Post by papa on Dec 7, 2021 21:34:18 GMT
Prepare OpenHAB for the LIFX Bulb
Go to localhost:8080/settings/addons/binding. There click the "+" icon & then search for & install the LIFX binding.
After that, I fussed long over successfully creating a LIFX White Thing for the LIFX binding, both via the inbox & manually. I did more research & found reference to LIFX using UDP port 56700. Oh, I wondered, does that port needs to be opened in the firewall?
The following is VERY important for openHAB success. It's for Linux, but in parallel, you can check Windows Firewall rules & create a new rule if necessary.
In Linux Terminal, execute sudo ufw status
To open UDP port 56700, in Linux Terminal, execute sudo ufw allow 56700/udp
Next, Create LIFX Thing in OpenHAB
|
|
|
Post by papa on Dec 6, 2021 22:43:14 GMT
Connect the LIFX Bulb to WiFi
On your smart phone, search for & install the LIFX app for your phone's operating system.
Important: The following works better if in your phone's settings, you temporarily turn off Mobile Data. Of course, have WiFi on & connected.
It may also help setup to power the bulb temporarily near your WiFi router. Use a light socket that has a switch.
In the LIFX app near the bottom right, click the "+" sign to add new device. Then click "New Device" & then "New Light." On the Setup page, click the green arrow at the bottom right. When the app finds your bulb, click "connect." Continue through the screens. For our openHAB purposes, you can stop when the bulb is connected to your WiFi.
Sometimes the LIFX app tells us to "try again." In that case, switch the bulb socket on & off five times with each switch being about 1 second apart. This resets the device. Start over with instructions in the previous paragraph.
Once the LIFX bulb is connected to WiFi, you can turn on the phone's Mobile Data.
Next, Prepare OpenHAB for the LIFX Bulb
|
|
|
Post by papa on Dec 6, 2021 22:26:43 GMT
LIFX Smart Bulb & OpenHAB, Introduction (Pronounced "Life X")
I was looking for a smart bulb that did not need a hub or bridge & could work with openHAB 3. I got this LIFX White bulb (model E26 base) for a standard U.S. bulb socket. Other types of bulbs (including color & other types of sockets) are available. These bulbs use an ESP32, but I have no plans so far to put new firmware on it. It uses 8.5 watts & can give a 50 watt equivalent of illumination (650 lumens). It seems to be fixed at a ("warm") 2700 Kelvin temperature/appearance. My LIFX White bulb can be set up & controlled with a smart phone, but I mainly used my phone to link the LIFX to my WiFi & update firmware (settings via the gear icon). I found some tricks for the WiFi & openHAB setup that I'll give below. Later on, I'll offer a rule that on a schedule will pulse the light as a possible wake-up alarm. Next, Connect the LIFX Bulb to WiFi
|
|
|
Post by papa on Nov 28, 2021 22:03:11 GMT
DIY Home Automation OptionsOpenHAB (currently OH3) coordinates this forum's DIY Home Automation, & MQTT messaging provides the means to communicate data. OpenHAB can coordinate some or all of the following options (possible communication distances increase with each option): WiFi nodes (ESP82xx or ESP32) connect directly to openHAB_MQTT via one's WiFi network.
Especially if node transmission frequency is at every 45 or 60 seconds or more, each Gateway can handle several nodes, perhaps 12.
As programmed so far, there can be up to ... 3 WiFi_RFM69 Gateways, 3 Ethernet_RFM69 Gateways, & 3 WiFi_RFM95 Gateways. Each of those 9 Gateway Networks can have nodeIDs from 05 through 255.
Nodes may send sensor data to openHAB or receive commands via openHAB
|
|
|
Post by papa on Nov 28, 2021 1:34:02 GMT
chehre, I'm very glad to hear that DIY Home Automation things have started to work reliably for you. You have accomplished a very big hurdle that should serve you well in future projects.
Yes, it would be great for you to document what got you though previous difficulties.
chehre: "other nodes' threads, I wonder if the OpenHAB configuration instructions given there are good to go with OH3!"
papa: Unless so indicated, those threads are not fully adapted to OH3. However, not much needs to be changed. Report what node thread you want to work on & I can help note adaptations that need to be made, even update the thread.
|
|
|
Post by papa on Nov 21, 2021 18:33:26 GMT
Thanks for understanding. Though they are old, couple things on Pi openhab & editing it's files may give you hints:
Re: edit files
|
|
|
Post by papa on Nov 21, 2021 13:17:17 GMT
greetings, chehre, I've seen that you stop by the forum regularly. I appreciate that you've tried to use the instructions here before asking for help. My problem is that shortly today, I will be unavailable for about a week & then will need to catch up a bit after that. I'm not sure what to say about your RFM69 difficulties. I'll need to think & (when I get opportunity) ask more questions. Meanwhile, your practicing with openHAB seems like a good idea. I'm rusty on using SSH.
Sorry, I must leave. I suggest you do an internet search on something like "SSH into openHAB files"
Couple of quick thoughts: 1) Can you attach a keyboard & a monitor to the Pi & just use Linux commands in the Pi's Terminal BTW you can edit protected Linux files by executing sudo leafpad in Terminal (or sudo [text editor name]. (you need to know the Pi's Linux password)
navigate leafpad to the files folder.
2) I vaguely remember that after you ssh into the Pi, that you basically have a Linux Terminal window to execute commands (like sudo leafpad)
|
|
|
Post by papa on Nov 14, 2021 20:28:25 GMT
Another Entry into OpenHAB Command Functions (Linux Terminal)
Enter: "log:tail" for an interleaved, color-coded display of the real-time contents of events.log & openhab.log. To stop the rolling logs display, enter [Ctrl] c
This way to monitor openHAB items states, warnings, & errors is easier to read.
Next: Make OpenHAB Automatically Start When the Linux Host Boots
|
|
|
Post by papa on Nov 14, 2021 20:15:26 GMT
OpenHAB Command Line Functions (Linux)
Usage: openhab-cli command [options]
Possible commands: backup [--full] [filename] -- Stores the current configuration of openHAB. clean-cache -- Cleans the openHAB temporary folders. console -- Opens the openHAB console. info -- Displays distribution information. reset-ownership -- Gives openHAB control of its own directories. restore filename -- Restores the openHAB configuration from a backup. showlogs -- Displays the log messages of openHAB. start [--debug] -- Starts openHAB in the terminal. status -- Checks to see if openHAB is running. stop -- Stops any running instance of openHAB
This list has useful access to certain openHAB related commands to execute in the Linux Terminal.
For example, "openhab-cli showlogs" (in real time) displays the new posts to openHAB's /var/log/openhab/events.log & /var/log/openhab/openhab.log. events.log displays updates in item states. openhab.log displays initializations, loadings of items & rules files, warnings, & errors. "[Ctrl] c" will stop the display & return to a terminal prompt.]
The logs display is one way to monitor openHAB & catch errors. Multiple errors & warnings can be confusing to watch so opening the logs files works better then.
Ahead: Another Entry into OpenHAB Command Functions
|
|
|
Post by papa on Nov 13, 2021 20:52:02 GMT
Powering Our RFM95 DevicesFor the ESP32_RFM95 Gateway, we'll probably use mains power via a 5vdc USB adapter or via a USB breakout board. Perhaps place the Gateway at a mains outlet where the Gateway can reliably connect to WiFi. For Arduino_RFM95 nodes, we can use mains power in our buildings or other locations that have such power. We may want to place nodes at a distance where mains power is not available. In that case, use battery power. Connect a battery or battery pack's negative terminal to an Arduino Gnd pin. Connect battery's positive terminal to Arduino VIN pin. For an Arduino with an Arduino Uno form factor (2 x 2.5 inches) & USB connector, perhaps use 7 to 12 volts DC. Basic Moteinos & MiniWireless do not have the power drain from the USB circuit. For a Moteino, its company suggests 3.3 to 9 volts DC connected to VIN & Gnd. The MiniWireless' company suggests 3.3 to 7 volts. The node sketch's TXinterval variable is presently set at a maximum 60 seconds between sending data, but data also may be sent when it changes. Increasing TXinterval (send data less often) might reduce battery drain. Using the choose_nodes sketch's SLEEPY function should decrease battery drain significantly & the function's code might be better tweaked. The Loops variable now counts a sleep period of 8 loops of 8 seconds (64 seconds). Loops could be increased to lengthen the sleep period & reduce battery drain. For any node function that is on/off, #define MAIL or #define SWITCHIRQ probably offers the least battery usage. Those options put the node to sleep until a change in the Arduino D3 (interrupt) pin wakes up the node to send data. For more, see here & here & here but remember these instructions need some adapting (see posts earlier in this thread). Personally, for a long distance node, I believe I'd battery power a MiniWireless or Moteino (without USB). If possible, I'd also use the MAIL or SWITCHIRQ options. What is working for you (& not) in powering remote nodes? How will you use the RFM95 devices?
|
|
|
Post by papa on Nov 13, 2021 20:00:29 GMT
How Far Can Our RFM95 Devices Communicate?
So far, instead of uni-directional antennas, we use plain wire antennas so our distance will likely be less than optimum. I'm not sure about installing a uni-directional antenna on an Arduino, but a hack might help the plain wire antenna. I believe some ESP32 boards have the option of using a uni-directional antenna. Perhaps that would help even if a node did not have a better antenna. I suspect that a uni-directional antenna could help reach some nodes & make it worse with other nodes. We might need more than one RFM95 Gateway (or RFM69 Gateway) to reach all our nodes.
I hope to do some testing. How does distance & obstacles & antenna affect your RFM95 communication?
Next, Powering Our RFM95 Devices
|
|
|
Post by papa on Nov 13, 2021 19:31:56 GMT
Many Node PossibilitiesNow that you have a working RFM95 Gateway, it can communicate with several more nodes. With an RFM69 Gateway built with an Arduino & an Ethernet shield, I've used about a dozen nodes. I did not try more than a dozen so that Gateway may have handled more nodes. I would think that an ESP32 RFM95 Gateway could handle a dozen or more nodes. The RFM95 choose_nodes sketch above has mostly the same coding (mainly except radio-related code) as the RFM69 choose_nodes sketch. Both sketches have many sensor & other functions that can be activated by UNcommenting (remove // at the start) sketch lines that start with #define. This forum board has detailed threads on building, customizing, & programming nodes with these sensors & functions. This post lists & links various node projects. With some adaptation, most RFM69 node code & instructions should work for RFM95 nodes. I'm not sure whether over the air programming is up to date. I briefly tested the SLEEPY function which seems to work. I'm just not sure the code takes full advantage of obtaining the lowest power drain. The schematics for RFM69 node projects can be used without change with RFM95 nodes. (especially since we don't really need to connect the RFM95 reset pin.) In general, when programming nodes, use a unique NODEID for each node & be careful to avoid using an Arduino pin number for more than one purpose. For setting up openHAB to communicate with your node, use hints in posts starting here to help you adapt RFM69 node instructions to RFM95 nodes. Next, How Far Can RFM95 Devices Communicate
|
|
|
Post by papa on Nov 12, 2021 22:00:21 GMT
Adapt Item to Link to Node85's Channel 16 This was the instructions for Node05. In an .items file, create an item entry based on the following. However, replace my channel UID with your channel UID determining it like in this post. This would be instructions for Node85. In an .items file, create an item entry based on the following. However, replace my channel UID with your channel UID determining it like in this post. To display the item's data on HABPanel, use a Switch widget. Next, Many Node Possibilities
|
|
|
Post by papa on Nov 12, 2021 21:52:19 GMT
An Example of Adapting a Channel From Node05 to Node85
This post gives one example of adapting a RFM69 Node05 Channel to a RFM95 Node85 Channel. This should help you adapt the other channels.
In the Add Channel Window, fill the fields with configs: (RFM95 Node85 version)
Channel identifier Node05Channel16 >> Node85Channel16 ^^ arbitrary ? as long as we match it in a linked Item (see below)
Label Node05_Switch >> Node85_Switch ^^ arbitrary ?, make it useful for yourself, but not too long
Channel type On/Off Switch >> No Change ^^ choose type compatible with the device/channel data type
MQTT State Topic home/rfm_gw/nb/node05/dev16 >> home/r95_gw/nb/node85/dev16 MQTT Command Topic home/rfm_gw/sb/node05/dev16 >> home/r95_gw/sb/node85/dev16
Click [Create] to save your configs
Next: Create Item to Link to Node85's Channel 16
|
|
|
Post by papa on Nov 12, 2021 21:39:16 GMT
OpenHAB & RFM95 Node Communicating Via the GatewaySucceeding with the above (Node communicating with the Gateway) is significant, but not very useful. However, with openHAB, we can collect data from a node (via the Gateway) & we can also communicate with & in some regards, control the node (via the Gateway). To install openHAB, see this thread. Especially see adding the MQTT Binding, For adding Things & Channels, see starting here. You will need to adapt from those openHAB posts as follows. Those posts are about Node 05 & if you followed the above instructions you created a Node 85. Your node85 has these devices & a Node85 Thing will need these channels: 00, 02, 04, 09, 16, 48, 49, & 50. Next, An Example of Adapting a Channel
|
|
|
Post by papa on Nov 11, 2021 21:21:14 GMT
RFM95 Node, Expected Results When Working Gateway & Node Are Communicating
With the Arduino node connected to computer's USB & the Node's port selected in Arduino IDE Tools/Port, open the Serial Monitor & see something like the following displayed from the node:
Next, OpenHAB & RFM95 Node Communicating Via the Gateway
|
|
|
Post by papa on Nov 11, 2021 21:08:32 GMT
RFM95 Gateway, Expected Results from Working Node
With the ESP32 Gateway connected to computer's USB & the ESP32 Gateway's port selected in Arduino IDE Tools/Port, open the Serial Monitor & see something like the following continue from the Gateway results displayed above :
The above represents the Gateway receiving successful communication from Node 85. The data is limited because sensors are not connected.
Next, RFM95 Node, Expected Results
|
|
|
Post by papa on Nov 11, 2021 20:54:35 GMT
Configure Arduino IDE & Upload Node Sketch
With the Node sketch (last post) open in Arduino IDE & the Node device connected to your computer's USB, configure Arduino IDE as follows ...
In Arduino IDE Tools/Board menu, select Arduino AVR Boards then (if possible) select the name of your board or a working equivalent. At the least, select Arduino Uno.
Tools/Port: Select the port that the computer/Arduino IDE assigned to your Arduino compatibl.
Check your work. Upload the Node sketch to the Arduino compatibl.
Next, RFM95 Gateway & Node, Expected Results
|
|
|
Post by papa on Nov 11, 2021 20:49:24 GMT
Programming & Customizing an RFM95 Node R95_choose_nodes_MhF9r2_pub.ino (137.17 KB) << Members, download this Node sketch & open it in Arduino IDE. Do NOT upload it until you customize as follows. Save your work as you go. Note: When you change a define in the Gateway sketch, change any matching define in the node sketch & vice versa. For example, if you UNcomment #define SECRET in the Gateway sketch, also UNcomment it in the Node sketch. If you want to use encryption, UNcomment #define SECRET. Also into the same folder as the node sketch, copy the two encryp.x files from this post & see an additional change below. Find #define NODEID 85 & for sake of demonstration, leave it as is. Later, this is where you give each node a unique identifying number. Find 3 lines with #define RF95_FREQ & according to your radio's frequency, UNcomment (remove initial //) only one of the lines. Find #define User_Installed_RFM95. UNcomment for user-installed radio. Comment (start the line with //) for ESP32 with pre-installed radio. If you installed the radio, find #define RFM95_CS & #define RFM95_INT (RFM95_RST is not needed). Make sure the pin assignments are correct.
Find #define Fahr & #define Cels. Uncomment only one.
Find & UNcomment #define HT. Find & UNcomment #define ACTOR
Find & UNcomment #define DS18. Skip a line & UNcomment #define DS18BFind #define NetworkOne & leave it UNcommented. Find ifdef NetworkOne. If you're using encryption, change the encryptkey (16 elements separated by commas, each element starts with 0x. The given encryptkey is too easy to guess. If & when you add NetworkTwo or NetworkThree, complete encryptkey as you did for NetworkOne. Next, Configure Arduino IDE & Upload Node Sketch
|
|
|
Post by papa on Nov 11, 2021 20:08:41 GMT
Not Needed: Connection to RFM95 Reset PinIt turns out that resetting the RFM95 radio is not needed. So the ESP32 & Arduino compatible no longer need connection to RFM95's reset pin. Accordingly, I updated the sketches so far posted in this thread. This applies to these linked sketches: Struct Server Struct Client ESP32-RFM95 GatewayThe upcoming Node sketch will also contain this change. Next, Programming & Customizing an RFM95 Node
|
|
|
Post by papa on Nov 11, 2021 16:59:05 GMT
Signal LEDs for ESP32 Boards with Pre-Installed Radios
As said above, the Gateway sketch uses two LEDs. Especially for when the Gateway will be disconnected from the Serial Monitor, one LED will blink once to signal that WiFi is connected & then will light steadily to indicate MQTT connected. The other LED will flash to signal when radio communication is happening with a node. For each LED, its originally shorter pin goes into an ESP32 ground. Via a 100 ohm resistor each originally longer pin goes into the ESP32 pin designated in the Gateway sketch. Before you solder the resistor to the LED's originally longer leg, shorten the leg & the resistor leg to make a good length for installing on the ESP32.
Where to attach the LEDs on the ESP32 board ...
My schematic/wiring diagram above & the downloaded Gateway sketch has the LEDs connected to ESP32 pins 12 & 16 & to conveniently located Gnd pins. You may change the pins for the LEDs, but you must also change the pin numbers in the Gateway sketch accordingly. Ahead, Programming & Customizing an RFM95 Node
|
|
|
Post by papa on Nov 10, 2021 21:06:40 GMT
RFM95 Gateway, Expected Results (No Matching Node Yet)
Without a matching node yet, you'll see only a little on the Arduino IDE Serial Monitor. However, what you see so far are important steps.
With the ESP32 Gateway connected to computer's USB & the ESP32 Gateway's port selected in Arduino IDE Tools/Port, open the Serial Monitor & see something like the following:
If you installed the indicator LEDs, one LED will blink once as it connects with WiFi & then it will shine steady when it connects to MQTT. The other LED will not light until the Gateway is communicating with a node.
Sometimes the above steps take a little while. If it does not seem to be working, press the ESP32 reset button & move the ESP32 to help align it better with your WiFi router.
Ahead, Preparing to Program an RFM95 Node
|
|
|
Post by papa on Nov 10, 2021 20:50:26 GMT
Configure Arduino IDE & Upload Gateway Sketch
With the Gateway sketch (last post) open in Arduino IDE & the Gateway device connected to your computer's USB, configure Arduino IDE as follows ...
In Arduino IDE Tools/Board menu, select ESP32 Arduino then (if possible) select the name of your board or a working equivalent. At the least, select ESP32 Dev Module.
Tools/Partition: Select one with "large App"
Tools/Core Debug: Select Verbose
Tools/Port: Select the port that the computer/Arduino IDE assigned to your ESP32.
Check your work. Upload the Gateway sketch to the ESP32.
Next, RFM95 Gateway, Expected Results
|
|
|
Post by papa on Nov 10, 2021 20:39:02 GMT
ESP32-RFM95 Gateway Programming & Customizing RF95_MQTT_GW_25.6.6_esp_pub.ino (29.68 KB) << Members, download this Gateway sketch & open it in Arduino IDE. Do NOT upload it until you customize as follows. Save your work as you go. In the sketch, find #define mqtt_server & between quote marks, give the IP address of your computer. Find 3 lines with #define RF95_FREQ & according to your radio's frequency, UNcomment (remove initial //) only one of the lines. If you want to use encryption, UNcomment #define SECRET. Also into the same folder as the Gateway sketch, copy the two encryp.x files from this post & see an additional change below. Find 4 lines starting with #define wifi_ & between the quote marks, give your WiFi credentials. If you want MQTT to require username & password, UNcomment #define MQTT_USER & #define MQTT_PASS & between the quote marks, give your MQTT credentials. Find #define User_Installed_RFM95. UNcomment for user-installed radio. Comment (start the line with //) for ESP32 with pre-installed radio. Find #define MQCON & #define R_LED. If you installed 2 indicator LEDs above, make sure you define the correct pins. If you did not install them, use -1 for pin numbers. If you installed the radio, find #define RFM95_CS & #define RFM95_INT (RFM95_RST is probably optional). Make sure the pin assignments are correct. Find ifdef NetworkOne. For byte ip, give an available IP address in your local network. If you're using encryption, change the encryptkey (16 elements separated by commas, each element starts with 0x. The given encryptkey is too easy to guess. If & when you add NetworkTwo or NetworkThree, complete byte ip & encryptkey as you did for NetworkOne. Next, Configure Arduino IDE & Upload Gateway Sketch
|
|
|
Post by papa on Nov 10, 2021 18:43:10 GMT
Preparing to Program the ESP32-RFM95 Gateway Install Mosquitto MQTT & Find Your Computer's IP Address
If you have successfully accomplished the above, you've done much of the challenging work of this project: You have an ESP32 & Arduino compatible with RFM95 radios, their software successfully initialized the radios, & the devices successfully communicated both directions. Now some other preparation. Install Mosquitto MQTT messaging: See here for guides to install Mosquitto on Windows or Linux. MQTT handles messaging between the Gateway & openHAB. In order to initialize, the Gateway sketch expects to connect with MQTT. See here for my notes on the Linux install of Mosquitto. See here for my notes on configuring Mosquitto 2 MQTT Broker in Linux. =============================================== Find the IP address of the computer that hosts Mosquitto MQTT. (The Gateway sketch needs it to know this.) See my notes here on doing this in Linux. For Windows, search for & open cmd. At the prompt, enter ipconfig ============================================ Be sure you have the code libraries from this post above. Next, the ESP32-RFM95 Gateway Programming
|
|
|
Post by papa on Nov 10, 2021 14:11:12 GMT
How Are You Doing So Far, Especially with Pre-Installed Radios?
Again, I've only made a RFM95 Gateway by my installing an RFM95 radio onto a Sparkfun ESP32 Thing.
I've only made a RFM95 node by my installing an RFM95 radio onto a Buno Uno Arduino compatible with an Arduino Uno form factor.
What I say about other ESP32 & Arduino compatibles (with pre-installed radios) is based on some research & experience, but you may need to work out more using device schematics & your own experience. Update: The ESP32 & Arduino's connection with RFM95 Reset is probably optional. Who used ESP32s or Arduino compatibles with pre-installed RFM95 radios? Did what I provided above work for you? What adjustments did you need to make?
Next, Preparing to Program the ESP32-RFM95 Gateway
|
|
|
Post by papa on Nov 9, 2021 21:19:10 GMT
R95 Struct Server & Client, Expected ResultsAfter you upload the customized sketch to the Arduino compatible with RFM95 radio, open the Arduino IDE serial monitor at 115200 baud. On the serial monitor screen, if you see "init failed" then check your work from the above post. If you see "radio init succeeded," that's good. Connect the ESP32 R95 struct server to a computer USB port. In Arduino IDE's Tools/Port, select the ESP32 server's port. Open the Arduino IDE Serial monitor at 115200 baud. In the client's serial monitor, you want to repeatedly see: In the server's serial monitor, you want to repeatedly see something like: Unless you change the client sketch, the nodeID will always be 85 & the payload will be "Hello World." The other items are randomly generated within ranges. Note: Again, this is not yet a node. That sketch comes later. This sketch programs a simple RFM95 client to test your radio & simple communication between two devices with RFM95 radios. If this simple server-client interaction worked, this is great preparation for a RFM95 Gateway & Nodes.
Next, How Are You Doing So Far, Especially with Pre-Installed Radios?
|
|
|
Post by papa on Nov 9, 2021 20:46:09 GMT
Preparing to Test the RFM95 Radio on the Arduino Client/NodeNow you're close to programming an Arduino compatible with pre-installed or user-installed RFM95 radio. Without a matching Arduino Gateway/Server, this device will not do much but initialize the radio. This post includes a fairly simple client sketch that will send a struct of data to a server which will reply to the client. This sketch does not have things we need later for a node. It does include a #define you can UNcomment for encryption, but (at least at first), I recommend you leave that commented (//) & disabled. The encryption #define line must be the same for server & client. If your Arduino compatible is thumbnail size & has a pre-installed radio, comment out #define Arduino_Uno_Form. If you have a user-installed radio on an Arduino Uno form factor (about 2 x 2.75 inches), UNcomment #define Arduino_Uno_Form. If you wired your RFM95 radio differently, adapt lines 33-35 accordingly. If you have a Moteino or Moteino USB, get its Arduino IDE add-on by using the instructions in the Programming & libraries section on this page. In the Arduino IDE Tools/Board menu, select a board name: For a Moteino, select Moteino AVR. For MiniWireless or Arduino Uno Form Factor, select Arduino Uno. Connect your board to your computer's USB port (via FTDI if necessary). In the Tools/Port menu select the computer port to which your board connected. R95_Struct_Client_B03.ino (4.52 KB) << Members, download this sketch to your Arduino IDE sketch folder. Open the sketch in the Arduino IDE & customize as above in this post. When you want to try the encryption, copy the 2 encrypt files from this post into the subfolder where the IDE places this sketch. Upload the customized sketch to the Arduino compatible with RFM95 radio.
Next, R95 Struct Server & Client, Expected Results
|
|
|
Post by papa on Nov 9, 2021 19:38:26 GMT
Repeated Disclaimers:
Again, I've only made a RFM95 Gateway by my installing an RFM95 radio onto a Sparkfun ESP32 Thing.
I've only made a RFM95 node by my installing an RFM95 radio onto a Buno Uno Arduino compatible with an Arduino Uno form factor.
What I say about other ESP32 & Arduino compatibles is based on some research & experience, but you may need to work out more using schematics & your own experience. Next, Preparing to Test the RFM95 Radio on the Arduino Client/Node
|
|
|
Post by papa on Nov 9, 2021 19:37:23 GMT
Testing the RFM95 Radio on the ESP32 Server/GatewayNow you're close to programming an ESP32 board with pre-installed or user-installed RFM95 radio. Without a matching Arduino Client/Node, this device will not do much but initialize the radio. This post includes a fairly simple server sketch that will receive a struct of data from a client (that sketch comes later). This sketch does not have things we need later for a gateway: WiFi & MQTT. It does include a #define you can UNcomment for encryption, but (at least at first), I recommend you leave that commented (//) & disabled. If your ESP32 board has a pre-installed radio AND your board is in the Arduino IDE Tools/Board menu, comment out #define User_Installed_RFM95. If you have Sparkfun ESP32 Thing (or probably ESP32 Dev Module or similar) AND wired the radio as in my schematic above, UNcomment #define User_Installed_RFM95. If you wired your RFM95 radio differently, adapt lines 16-18 accordingly. If possible in the Arduino IDE Tools/Board menu, select your ESP32 board's name. In the Tools menu select Partition Scheme: large APP. Connect your ESP32 board to your computer's USB port (via FTDI if necessary). In the Tools/Port menu select the computer port to which your board connected. R95_Struct_Server_B03_esp.ino (5.84 KB) << Members, download this sketch to your Arduino IDE sketch folder. Open the sketch in the Arduino IDE & customize as above in this post. When you want to try the encryption, copy the 2 encrypt files from this post into the subfolder where the IDE places this sketch. Upload the sketch to the ESP32 with RFM95 radio. Open the Arduino IDE serial monitor at 115200 baud. On the serial monitor screen, if you see "init failed" then check your work from this post. If you see "radio init succeeded," then so far, so good. No more serial Output will occur until the R95_Struct_Client sketch is successfully running.
Note: Again, this is not yet a gateway. That sketch comes later. This sketch programs a simple RFM95 server to test your radio.
Next, Preparing to Test the RFM95 Radio on the Arduino Client/Node
|
|