mirror of
https://github.com/Brandon-Rozek/website.git
synced 2024-11-09 10:40:34 -05:00
Compare commits
2 commits
37f85fa663
...
6571f8449f
Author | SHA1 | Date | |
---|---|---|---|
6571f8449f | |||
d9abc046f6 |
3 changed files with 109 additions and 0 deletions
57
content/blog/test-mqtt.md
Normal file
57
content/blog/test-mqtt.md
Normal file
|
@ -0,0 +1,57 @@
|
|||
---
|
||||
title: "Quickly configuring and testing the Mosquitto MQTT broker"
|
||||
date: 2023-10-30T01:01:57-04:00
|
||||
draft: false
|
||||
tags: []
|
||||
math: false
|
||||
medium_enabled: false
|
||||
---
|
||||
|
||||
I've been playing with Tasmota smart devices recently; and to hook them up with home assistant, they both need to be configured to utilize MQTT. In this post, we'll only focus on the MQTT part. From quickly installing it to making sure publish/subscribe messages work on another machine.
|
||||
|
||||
## Installing MQTT Broker
|
||||
|
||||
On the server you want to install MQTT on:
|
||||
|
||||
```bash
|
||||
sudo dnf install mosquitto
|
||||
```
|
||||
|
||||
We won't go over how to setup TLS or authenticated users. Instead for a quick test, we'll configure it to allow for anonymous connections over any interface.
|
||||
|
||||
Add the following lines to `/etc/mosquitto/mosquitto.conf`
|
||||
|
||||
```
|
||||
listener 1883
|
||||
allow_anonymous true
|
||||
```
|
||||
|
||||
Then enable the systemd service to start mosquitto
|
||||
|
||||
```bash
|
||||
sudo systemctl enable --now mosquitto
|
||||
```
|
||||
|
||||
Make sure it's running:
|
||||
|
||||
```bash
|
||||
sudo systemctl status mosquitto
|
||||
```
|
||||
|
||||
## Testing the Broker
|
||||
|
||||
Most tutorials have you test the publish/subscribe on the local machine. Though given we're working with smart devices, we need to make sure it works on another machine first.
|
||||
|
||||
**Approach 1:** Install the mosquitto tools on that machine. Then you'll need to open two terminals.
|
||||
|
||||
- On terminal 1, subscribe to all messages `mosquitto_sub -h [MQTT_BROKER_ADDR] -t "#" `
|
||||
- On terminal 2, publish a message: `mosquitto_pub -h [MQTT_BROKER_ADDR] -t "test" -m "Hello, World"`
|
||||
|
||||
On the first terminal, you should see the string `Hello, World`.
|
||||
|
||||
**Approach 2:** Use curl.
|
||||
|
||||
- On terminal 1, subscribe to all messages with `curl mqtt://[MQTT_BROKER_ADDR]/%23 --OUTPUT - --trace -`
|
||||
- On terminal 2, publish a message `curl -d 'Hello, World' mqtt://[MQTT_BROKER_ADDR]/test/`
|
||||
|
||||
Similarly, you should see the string `Hello, World` along with a bunch of debugging information.
|
|
@ -52,6 +52,7 @@ The following menu contains meals that are in rotation at my home. These are mad
|
|||
- [Turkey Club](turkey-club-sandwich/)
|
||||
- {{< vegetarian >}}[Black Bean Quesadilla](black-bean-quesadilla)
|
||||
- Tuna Sandwich
|
||||
- [Beef Bean Burrito](beef-bean-burrito/)
|
||||
|
||||
### Dinner
|
||||
|
||||
|
|
51
content/menu/beef-bean-burrito.md
Normal file
51
content/menu/beef-bean-burrito.md
Normal file
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
title: "Beef Bean Burrito (WIP)"
|
||||
draft: false
|
||||
---
|
||||
|
||||
Prep Time: 5 Minutes
|
||||
|
||||
Cook Time: 20 Minutes
|
||||
|
||||
Total Time: 30 minutes
|
||||
|
||||
## Ingredients
|
||||
|
||||
- Beef (Optional)
|
||||
|
||||
- 1 teaspoon garlic powder
|
||||
|
||||
- 1 teaspoon cumin
|
||||
|
||||
- 1 teaspoon chilli powder
|
||||
|
||||
- 16 oz can refried beans
|
||||
|
||||
- 3 tablespoon worchestire sauce
|
||||
|
||||
- 1/2 tablespoon sour cream
|
||||
|
||||
- Green peppers
|
||||
|
||||
- 1/2 Yellow Onion
|
||||
|
||||
- Vegetable oil
|
||||
|
||||
- Shredded Mexican cheese
|
||||
|
||||
|
||||
|
||||
## Recipe
|
||||
|
||||
1. Oil pan, cook onions until firm. Put aside onions on separate plate
|
||||
2. (Optional) Cook beef on same pan, drain grease as necessary. Season with garlic powder, cumin, and chilli powder as you go.
|
||||
3. Separate pot, boil green peppers for 10 minutes
|
||||
4. Once beef is cooked, add refried beans, use fork to mix the two. Add seasoning if not done in step 2.
|
||||
5. Add Worcestershire sauce mix well
|
||||
6. Add sour cream, mix well
|
||||
7. Add onion and green peppers to the mixture
|
||||
8. Sprinkle the shredded mexican cheese onto a tortilla and warm it up in the microwave for 10 seconds
|
||||
9. Put bean mixture on top of tortilla
|
||||
10. Wrap and serve
|
||||
|
||||
Note: Clare mentioned that the bean burrito would be more satisfying if I add white rice. Need to experiment with that...
|
Loading…
Reference in a new issue