Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
Sicherheitslücken (CVE)USN-8821-1: OpenStack Swift vulnerability(24.09.2026 um 21:18 Uhr)
•
Sicherheitslücken (CVE)USN-8820-1: curl vulnerabilities(24.09.2026 um 22:13 Uhr)
•
Linux Tipps & HardeningDSA-6512-1 libreoffice - security update(24.09.2026 um 02:00 Uhr)
••••••••
Sicherheitslücken (CVE)USN-8821-1: OpenStack Swift vulnerability(24.09.2026 um 21:18 Uhr)
•
Sicherheitslücken (CVE)USN-8820-1: curl vulnerabilities(24.09.2026 um 22:13 Uhr)
•
Linux Tipps & HardeningDSA-6512-1 libreoffice - security update(24.09.2026 um 02:00 Uhr)
•••••••
Intelligence View
⚡ tsecurity.de Intelligence

Self-Aligning Satellite Dish in Rust: Compass Example

Create a new file compass.rs under the examples directory and copy the contents of src/main.rs into it. Clear the super loop. We will replace it with an example application code to test the compass section of our project. Table…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Create a new file compass.rs under the examples directory and copy the contents of src/main.rs into it. Clear the super loop. We will replace it with an example application code to test the compass section of our project.






Table of contents




  • Requirements


  • Implementation


    • Connections Diagram

    • Raw Data

    • Calibration

    • Magnetic Heading & Strength






  • Results









Requirements




  • 1 x Raspberry Pico board

  • 1 x USB Cable type 2.0

  • 1 x HC-05 Bluetooth module

  • 1 x HMC5833L Compass Module

  • 15 x M-M jumper wires

  • 2 x Mini Breadboards








Implementation








Connections Diagram



compass-setup








Raw Data



Under loop we'll read from the HMC5883L's data registers and wait for interrupts.



From the Compass' manual we find that we only have to point to the address of DATA_OUTPUT_X_MSB_R and the pointer automatically updates to read the values from the remaining data registers.



Place the constant DATA_OUTPUT_X_MSB_R.




// Data Registers.
const DATA_OUTPUT_X_MSB_R: u8 = 0x03;// HMC5883L







❗ Please note the order in which the magnetometer produces the output: x, z and then y.





            // Read raw data from compass.
// Point to the address of DATA_OUTPUT_X_MSB_R
writebuf = [DATA_OUTPUT_X_MSB_R];
i2c_write(&mut i2c0, HMC5883L_ADDR, &mut writebuf).unwrap();
// Read the output of the HMC5883L
// All six registers are read into the
// rawbuf buffer
let mut rawbuf: [u8; 6] = [0; 6];
i2c_read(&mut i2c0, HMC5883L_ADDR, &mut rawbuf).unwrap();

let x_h = rawbuf[0] as u16;
let x_l = rawbuf[1] as u16;
let z_h = rawbuf[2] as u16;
let z_l = rawbuf[3] as u16;
let y_h = rawbuf[4] as u16;
let y_l = rawbuf[5] as u16;

let x = ((x_h << 8) + x_l) as i16;
let y = ((y_h << 8) + y_l) as i16;
let z = ((z_h << 8) + z_l) as i16;

// Prints raw data
writeln!(serialbuf, "x: {} y: {} z: {}", x, y, z ).unwrap();
transmit_uart_data(uart_data.as_mut().unwrap(), serialbuf);






Building and loading the program into the Pico will give us raw data from the magnetometer.




cargo run --example compass






Raw compass data should be regularly sent to the Serial console.



compss-raw-data








Calibration



We can conduct a simple test for our magnetometer to check for accuracy. On a flat surface turn the magnetometer through 360 degrees while recording the output values.




For more reliable results try and conduct the test away from permanent magnets like those in speakers to avoid too much hard iron distortion.




Have the printed raw data into an Excel sheet or similar software and plot the x, y and z points on a scatter graph. A reasonable circle should result. If the circle is not centered at the graph's origin the compass requires calibration.



uncalibrated-raw-data



A quick and dirty solution to this is to introduce offsets that will roughly bring the circle's center to the origin of the graph. Perform the test again until a reasonable circle is achieved. For my case I found that I had to add 75, 185 and 115 to the x, y and z coordinates.



calibrated-raw-data




Note that these values will be different at different locations. This lopsidedness of the circle is due to magnetic noise from the vicinity of the magnetometer. Introducing a permanent magnet near it for example will result in different values.



Before deploying the project we should remember to conduct another calibration while the magnet sits in its final position.




Correct the printed raw data.




            // Prints raw data
writeln!(serialbuf, "x: {} y: {} z: {}", x + 75, y + 185, z + 115).unwrap();
transmit_uart_data(uart_data.as_mut().unwrap(), serialbuf);











Magnetic Heading & Strength



We can now calculate the magnetic heading from the raw data above. There are a number of configurations with which to translate this raw data.



We shall use the North-Clockwise convention as it has the x-axis pointing North which aligns with our final project design.




            // North-Clockwise convention
let mut heading = (y as f32 + 185.).atan2(x as f32 + 75.);






Continue by adding the magnetic declination to the heading value, converting to radians, handling any instances of overflow and finally converting back to degrees for printing.




Do not forget to declare the declination constant. This value is different for every location. You can check for your area here.





const MAGNETIC_DECLINATION: f32 = 1.667;

heading += MAGNETIC_DECLINATION*(PI/180.);// add declination in radians

// Check for sign
if heading < 0. {
heading += 2.*PI;
}

// Check for value wrap
if heading > 2.*PI {
heading -= 2.*PI;
}

heading *= 180./PI;






From the raw magnetic data the magnetic strength can also be calculated. We first factor in the Magnetometer Gain we set in the earlier part.




            // Calculating mag strength
let x = (f32::from(x) + 75.)/ 1090.;
let y = (f32::from(y) + 185.)/ 1090.;
let z = (f32::from(z) + 115.)/ 1090.;

let mag = (x*x + y*y + z*z).sqrt();






Printing the results...




            writeln!(serialbuf, "{} deg. {} uT", heading.round(), (mag*100.).round()).unwrap();
transmit_uart_data(uart_data.as_mut().unwrap(), serialbuf);











Results



Here is the final code of this part.



Flashing into the Pico we should be able to see the printed values of the raw magnetic values the heading and magnetic strength.



compass-example-results



In the next part of the series we'll apply the above to our larger project.

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - Self-Aligning Satellite Dish in Rust: Compass Example
id: 009f9e46-20a4-4bcd-b944-ae7f64c362bc
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Self-Aligning Satellite Dish i" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Self-Aligning Satellite Dish in Rust Com")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Self-Aligning Satellite Dish in Rust Com*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Self-Aligning Satellite Dish in Rust Com"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Self-Aligning Satellite Dish in Rust: Co.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Self-Aligning Satellite Dish in Rust: Compass Example

Thematisch verwandte Begriffe: SelfAligning, Satellite, Dish, Rust · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-81473 | Dell Rugged Control Center (RCC), versions prior to 5.2.206, contain an …
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...
↗ Original-Quelle