Skip to content

Get Help

9 Topics 9 Posts

Stuck? Post here. Search the Troubleshooting Index first.

This category can be followed from the open social web via the handle get-help@forum.grapesiot.com

Subcategories


  • C programming, FreeRTOS tasks, queues, mutexes, state machines, watchdog

    1 1
    1 Topics
    1 Posts
    A
    Half of firmware debugging is how you ask. A good report gets you an answer in an hour; "it doesn't work" gets you silence. Use this format every time: What I'm trying to do: one sentence — the goal, not the method. What I tried: the steps, in order. "Changed the baud rate, added a delay, swapped cables." What happened: exact text, not paraphrase. Paste the panic dump, the serial output, the wrong value. My setup: board (ESP32 DevKitC? which revision), IDE + version, relevant library versions. Minimal code: the smallest snippet that reproduces it — 20 lines beats 500. Use code blocks, never screenshots of code. Serial output: pasted as text, from boot to failure. Decode your own crash first A Guru Meditation Error print is a gift — it tells you the exception cause, the guilty program counter, and a backtrace. The fastest path: rebuild the exact same binary with symbols, feed the addresses to the decoder, and read the function names. Nine times out of ten it lands on one of these: Stack overflow — a task with a 1 KB stack calling deep library functions, or a large array declared inside a function. Symptom: crash inside random-looking code, corrupted backtrace. Fix: grow the stack, move big buffers to static/global. Watchdog bite — a task that never blocks. Any loop without a delay or blocking call starves the idle task and the watchdog resets the chip. Fix: yield every iteration. Null / wild pointer — dereferencing a queue handle or object that was never created, or used after deletion. Symptom: LoadProhibited on an address near zero. Fix: check every create call's return before use. Shared state without protection — a variable touched from a task and an ISR (or two tasks) with no guard. Symptom: works for hours, then corrupts once. Fix: qualifier or guard, depending on who shares it. The five gotchas that solve most posts here ADC reads garbage with WiFi on → use ADC1 pins, never ADC2 under WiFi. Board resets randomly on USB → weak cable or port; measure the rail under load, try a shorter cable and a powered hub. Serial shows garbage → monitor baud must match Serial.begin() exactly. "Worked yesterday" → something changed: code, wiring, power source, library update. Figure out what, then bisect it. Timing drift under WiFi → never use blocking delays for cadence; sample on a stable timebase. Post with the format above and tag with firmware, freertos or esp32.
  • WiFi reconnect, MQTT broker, TLS, BLE, Modbus RTU, offline buffering

    2 2
    2 Topics
    2 Posts
    A
    Quickstart: Device → MQTT → Live Monitor This is the shortest path from a terminal to a live value in GrapesIoT. You need: a product with at least one data point, a device assigned to that product, the device's MQTT credentials, a machine with Node.js 18+ (for the sample publisher). [image: 1794556167890-01-credentials.png] Each device gets a unique client ID (also the MQTT username) and password. Treat the password like a secret. 1. Collect the connection details Open Devices and find the device card. Setting Where to find it Notes Broker URL This guide mqtt://dev.grapesiot.com:1883 Device ID Device route / device record Used in the topic MQTT username Device card → Client ID Usually the same as the device ID MQTT password Device card → Password Secret; do not commit it Topic Built from the device ID 1v0/<DEVICE_ID>/uplink If your deployment uses a different broker, use that host and port. The public broker above is for the hosted test environment; production deployments should use TLS and your own hostname. 2. Understand the envelope Every uplink is a JSON object with four required fields: { "type": 0, "stype": 0, "data": { "temp": 25.4, "humidity": 60, "pump": true }, "dir": 49 } Field Value Meaning type 0 DATA packet stype 0 Device-native sensor reading data object dpcode: value pairs dir 49 Required direction field. For DATA, the server requires it to be present; it does not use it to route the reading. Rules that matter: data keys must exactly match the product's data point codes. data can contain one key or many. Unrecognised keys are ignored, so a typo looks like “nothing happened”. The payload must be smaller than 4,100 bytes. Do not use dpid in the payload. Use dpcode. 3. Publish with Node.js Create a scratch folder and install the MQTT client: mkdir grapes-mqtt-test cd grapes-mqtt-test npm init -y npm install mqtt Create publish.mjs: import mqtt from 'mqtt' const BROKER_URL = process.env.MQTT_URL ?? 'mqtt://dev.grapesiot.com:1883' const DEVICE_ID = process.env.DEVICE_ID const MQTT_USERNAME = process.env.MQTT_USERNAME ?? DEVICE_ID const MQTT_PASSWORD = process.env.MQTT_PASSWORD if (!DEVICE_ID || !MQTT_PASSWORD) { console.error('Set DEVICE_ID and MQTT_PASSWORD first.') process.exit(1) } const topic = `1v0/${DEVICE_ID}/uplink` const payload = { type: 0, stype: 0, data: { temp: 25.4, humidity: 60, pump: true, }, dir: 49, } const client = mqtt.connect(BROKER_URL, { username: MQTT_USERNAME, password: MQTT_PASSWORD, clientId: MQTT_USERNAME, clean: true, reconnectPeriod: 0, }) client.on('connect', () => { console.log('connected to', BROKER_URL) client.publish(topic, JSON.stringify(payload), { qos: 1 }, (err) => { if (err) console.error('publish failed:', err) else console.log('published to', topic) client.end() }) }) client.on('error', (err) => { console.error('connection error:', err.message) client.end() }) Run it: $env:DEVICE_ID="<your-device-id>" $env:MQTT_USERNAME="<client-id>" $env:MQTT_PASSWORD="<device-password>" node publish.mjs On macOS or Linux: DEVICE_ID="<your-device-id>" \ MQTT_USERNAME="<client-id>" \ MQTT_PASSWORD="<device-password>" \ node publish.mjs A successful run prints: connected to mqtt://dev.grapesiot.com:1883 published to 1v0/<device-id>/uplink 4. Verify in the monitor Open the device and click Monitor Device. The connection pill should move to Live and any widgets bound to temp, humidity, or pump should update. [image: 1794556168434-02-monitor-live.png] When the payload reaches the broker, the monitor switches to Live and the bound widgets update. If the pill is live but a widget does not change, the message reached the device but the widget is not bound to the data point you published. Check the binding in UI Studio. 5. What the server does with the message Authenticates the MQTT client with the device credentials. Parses the JSON envelope and requires type, stype, data, and dir. Matches each data key to a data point code in the device's product. Updates the device's live state. Writes history if the data point has Storage enabled. Pushes the update to connected monitors over WebSocket. That is why a wrong dpcode can look like a successful publish: the broker accepted it, but the platform had nothing to update. Troubleshooting Symptom Likely cause Fix Connection refused or Not authorized Wrong host/port, client ID, or password Re-copy the credentials; check the broker URL Publish succeeds, monitor stays Not connected Wrong device ID in the topic Use the device UUID, not the product name Monitor is Live, widget does not move Widget not bound, or wrong dpcode Check the Logic tab binding and the payload key Values look like strings Type mismatch Send numbers for INT, booleans for BOOL payload too large Payload over 4,100 bytes Send fewer fields or split the message Security notes Never commit the device password. Use environment variables or a local .env file that is git-ignored. Mask credentials before posting screenshots. Use TLS and a private broker for production. The test broker in this guide is for getting started only. Rotate a device password immediately if it is exposed. Next Data Point Types Explained for choosing the right type and direction. Your First Dashboard in UI Studio for binding the values you just published. Protocol overview: https://embiq.grapesiot.com/protocol
  • Install issues, build errors, flash problems, PlatformIO, compiler flags

    0 0
    0 Topics
    0 Posts
    No new posts.
  • Dashboard, alerts, fleet management, OTA, API, TimescaleDB, webhook

    4 4
    4 Topics
    4 Posts
    A
    Your First Dashboard in UI Studio UI Studio turns a product's data points into a mobile-style dashboard. No app build, no separate frontend project: you arrange widgets on a canvas, bind them to data points, and publish. This guide builds a small greenhouse screen with three values and one control. [image: 1794556172630-01-screens.png] The UI Studio workspace previews a product dashboard and opens the full editor in a new tab. Before you start You need: a product with data points, at least one device assigned to that product, the device online or publishing (so you can see values move). If you have not published a message yet, do the Quickstart: Device → MQTT → Live Monitor first. A dashboard with no data is hard to debug. 1. Open the studio There are two entry points: From a product card: click UI Studio. This opens the studio for that product in a new tab. From the sidebar: open UI Studio, pick the product, then click Open in Studio. The product-card route is the fastest way to start from scratch. The sidebar workspace shows the current dashboard and its component and effect counts. 2. Know the three areas The studio has three working areas: Palette on the left: the widgets you can add. Canvas in the middle: a mobile-style surface at a fixed design width. Property panel on the right: the selected widget's settings. [image: 1794556173761-03-widget-palette.png] The palette groups widgets by job: controls, charts, UI basics, controllers, and effects. The palette groups widgets by job. You will use these groups most often: CONTROL — toggles, sliders, input fields. CHARTS — line graphs and other history views. UI BASICS — text, meters, icons, shapes, colour pickers. CONTROLERS — scroll pickers, steppers, function sliders. EFFECTS — motion and other visual effects. The exact list depends on your build. If a widget is missing, it may be a newer widget that is not enabled for your account. 3. Add widgets Drag a widget from the palette onto the canvas, or click it to add it at a default position. For the greenhouse screen: Area Widget Bound data point Top Text none (title) Row 1 Value / Status temp Row 1 Value / Status humidity Row 2 Line Graph temp (history) Row 3 Toggle Switch pump Keep the canvas focused. A dashboard that shows everything is harder to use than one that answers a single question. [image: 1794556173188-02-canvas.png] The canvas is a mobile-style surface. Drag widgets from the palette, resize them, and bind each one to a data point. 4. Style and layout Select a widget to open the property panel. The tabs are: Tab What it controls STYLE Colors, typography, borders, backgrounds LAYOUT Position, size, alignment, spacing LOGIC Data binding and behaviour EFFECTS State-based visual changes [image: 1794556174353-04-property-panel.png] Select a widget to edit its style, layout, logic and effects. Logic is where data binding lives. Use LAYOUT to align widgets to a grid. The canvas is mobile-first; keep touch targets large enough to tap and avoid placing controls at the very edge. 5. Bind data Open the LOGIC tab and find Data Binding. [image: 1794556174916-05-data-binding.png] Pick the device and data point in the Logic tab. The widget starts receiving live values as soon as the device publishes. Choose the device. Choose a data point. Confirm the widget supports that data point's type. Binding rules to remember: A Status point can be read by a display widget. A Control point can be written by a toggle, slider, or button. A Both point can be read and written. A numeric widget will not bind to a string point, and a boolean widget will not bind to a number. If the data point list is empty, the device may not be assigned to the product, or the product may not have compatible points. For a line chart, bind history. If the data point does not have Storage enabled, there is no history to draw; the chart will be empty even though the live value updates. 6. Add effects (optional) EFFECTS lets a widget change its appearance based on a value. Typical uses: turn a status tile red when temperature is above a threshold, change an icon when a pump is running, show a warning state when a battery is low. Effects are evaluated on the client from live values. They are not server-side automations. Use the Automation section if you need to trigger an action rather than change a visual. 7. Publish Click PUBLISH in the top bar. The current layout is frozen into a read-only screen. [image: 1794556175450-06-published.png] PUBLISH freezes the current layout into a read-only screen that the device monitor and mobile clients can consume. The published screen: appears in the UI list, can be opened in the studio for further editing, is what the device monitor renders, is read-only at runtime, so users cannot accidentally move widgets. Publishing does not deploy firmware and does not change the data model. It only snapshots the layout and bindings. 8. Verify with live data Open the device monitor and publish a message. Confirm: the connection pill reaches Live, each bound widget shows the expected value, the toggle writes a control message when tapped, the chart fills if history is enabled. If a value is stale, check the binding first, then the payload key. A typo in dpcode is the most common cause of an empty widget. A good first-screen checklist One clear purpose per screen. A title that says what the screen is for. The three or four values that matter most, not every value in the product. Controls that are visually distinct from read-only values. Large touch targets and consistent spacing. A test with real data before you publish to users. Common questions Can I reuse a screen across devices? Bindings are per widget. If devices share the same product and data point codes, you can copy the layout and change the device binding. Keep one screen per product family. Why is my chart empty? The data point probably has Storage disabled, or the device has not published enough history yet. Why can't I bind a control? The data point is probably Status only. Change it to Both or Control, or use a display widget instead. Does publishing affect the device? No. Publishing only snapshots the dashboard. It does not send anything to the device. Next Data Point Types Explained for choosing the right widget and direction. Quickstart: Device → MQTT → Live Monitor for getting values into the platform.
  • Sensors, power supply, oscilloscope, PCB basics, component selection

    1 1
    1 Topics
    1 Posts
    A
    Nobody can debug wiring from "I connected everything correctly but it doesn't work." Show this instead: A clear top-down photo — every wire visible, good light, no spaghetti hiding the pins. A sketch of the circuit — hand-drawn is fine: which pin goes where, where power enters, where ground returns. Part numbers and supply specs — exact sensor module, what powers it (USB? 5V adapter? battery?), and what the rail measures under load. The symptom with numbers — "reads 0", "reads 4095 constantly", "resets when the motor starts", plus what you already tried. The gotchas that solve most posts here No common ground. Two boards or a board + external supply without shared GND gives garbage or nothing. Tie grounds together, always. 5V into a 3.3V pin. A 5V sensor output (looking at you, HC-SR04 echo) into an ESP32 GPIO will damage it. Divide down or level-shift first. Missing pull-ups. I2C needs them (4.7k to 3.3V is the standard starting point); floating inputs read noise. Motors and relays on the logic supply. They droop and spike the rail — the MCU browns out and resets exactly when the motor starts. Separate supply (shared GND), bulk capacitance at the driver, and a flyback diode across relay coils and brushed motors. GPIO pins can't drive loads. A pin signals; it doesn't power. Relays, motors, and long LED strips switch through a transistor or MOSFET with its own supply — never straight off the pin. Decouple like you mean it. A capacitor close to every IC's supply pins eats the high-frequency noise that causes "random" glitches. Post the photo, the sketch, and the measured numbers. Tag with hardware, wiring or sensors.
  • 0 Votes
    1 Posts
    175 Views
    A
    Troubleshooting Index Search this page (Ctrl+F) for your error message before posting. GrapesIDE & Toolchain Error Cause Solution A fatal error occurred: Failed to connect to ESP32 Board not in flash mode Hold BOOT button while clicking Upload No serial port found Driver not installed Install CH340 or CP2102 driver Sketch too large Binary exceeds flash Change Partition Scheme to "No OTA (2MB)" 'x' was not declared in this scope Missing #include or typo Add the correct header file implicit conversion loses integer precision Type mismatch Cast explicitly or fix variable type warning: unused variable Variable declared but never used Remove or use the variable. Enable -Werror — this must be fixed ESP32 Hardware Error / Symptom Cause Solution ADC reads 0 or noise during WiFi ADC2 conflicts with WiFi Switch to ADC1 channels (GPIO32-39) GPIO reads random values (floating) No pull-up/pull-down Add 10kΩ pull-up or enable internal pull-up Device resets randomly Brownout — supply voltage too low Measure VCC under load. Use better USB cable/adapter Serial output garbled Wrong baud rate in monitor Match Serial.begin() rate exactly LED on but dim GPIO current limit exceeded Add current-limiting resistor FreeRTOS Error / Symptom Cause Solution Guru Meditation Error: Core panic'd Stack overflow, null deref, WDT Decode with addr2line — see Block 2 Crash Lab Task watchdog got triggered: taskName Task running without vTaskDelay Add vTaskDelay(pdMS_TO_TICKS(1)) in loop Device freezes randomly Deadlock between mutexes Check mutex acquisition order — always same order across tasks assert failed: queue.c Queue full with no space Increase queue size or consume faster Device reboots every N seconds WDT not being reset Add esp_task_wdt_reset() or vTaskDelay in busy tasks MQTT & Connectivity Error / Code Cause Solution PubSubClient state -2 (CONNECT_FAILED) Wrong credentials or broker down Check username/password/token PubSubClient state -4 (TIMEOUT) Wrong broker IP/port, firewall Verify host, port 8883 for TLS PubSubClient state 5 (UNAUTHORIZED) ACL blocked the topic Check topic matches your device_id exactly TLS certificate verify failed Wrong CA cert or device clock wrong Sync NTP before TLS connect TLS handshake timeout Heap too low for TLS Need >50KB free heap — check esp_get_free_heap_size() WiFi connects but MQTT fails TLS port blocked by ISP/router Try port 8083 (WS) or check firewall rules Messages not arriving QoS mismatch Check publisher and subscriber QoS match GrapesIoT Platform Symptom Cause Solution Device shows offline in dashboard LWT not configured or WiFi down Check MQTT connection and LWT topic OTA command sent but device ignores Device not subscribed to /down/# Check subscription in firmware Dashboard shows old data Retained message from previous session Clear retained by publishing empty payload Alarm not triggering Wrong field path in rule config Check dot-notation path matches payload key GrapesIDE Specific Issue Solution Autocomplete not working Restart IntelliSense: Ctrl+Shift+P → Reload Window Board not detected on Mac Allow USB accessories in System Settings → Privacy Build slow Exclude .pio folder from antivirus Last updated by instructor. Post below if you have a new error+solution to add.