commit f5018ec771d686c8d373e9eaa3b5010d2d43bc2c Author: Boyan Date: Tue Jun 27 19:48:12 2023 +0300 Initial commits, migrating repo diff --git a/README.md b/README.md new file mode 100644 index 0000000..983d31e --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# fosdem-talk + +A FOSDEM talk about the wonders of the amateur radio world. And SDRs and stuff. + +## Notes + +Outline: + Introduction to Amateur Radio: + * Brief history of the hobby. + + Communication in Amateur Radio: + * Baofeng UV5R(the default radio) + * Exploring the various modes of communication, such as voice, Morse code, digital modes, and satellite communication. + * Overview of HAM communications - local and global. + * Even in the absence of traditional infrastructure during emergencies or natural disasters. + * Highlighting the role of amateur radio in providing a platform for international friendships. + + Hardware in Amateur Radio: + * Overview of equipment + * Discussing the design and construction of homebrew equipment, fostering creativity and technical skills. + + Software in Amateur Radio: + * Introducing software applications used for signal processing, digital modes, and satellite tracking. + * Discussing the integration of amateur radio with open-source software and its impact. + + Conclusion and Q&A Session: + * Highlighting the community-driven nature of amateur radio. + * Regulatory aspects and licensing requirements. + * Summarizing the key takeaways and the enduring appeal of the amateur radio hobby. + * Engaging the audience in a Q&A session to address their queries and encourage further exploration. diff --git a/rc-car/.gitignore b/rc-car/.gitignore new file mode 100644 index 0000000..1e78bdb --- /dev/null +++ b/rc-car/.gitignore @@ -0,0 +1,4 @@ +_env/ +old/ +__pycache__/ +.ipynb_checkpoints/ diff --git a/rc-car/RCCar.py b/rc-car/RCCar.py new file mode 100644 index 0000000..1dcabae --- /dev/null +++ b/rc-car/RCCar.py @@ -0,0 +1,52 @@ +from subprocess import run, DEVNULL +from os import path +from enum import Enum +from time import sleep + +class Direction(Enum): + FORWARD = "Forward.complex" # car go vroom vroom random distances + BACKWARD = "Back.complex" # same here but backwards + LEFT = "Left.complex" # 360 + n*36 degrees at a time + RIGHT = "Right.complex" # 360 + n*40 degrees at a time + FINE_FORWARD = "Fine_forward.complex" # 30cm + FINE_BACKWARD = "Fine_back.complex" # 30~cm + +class RCCar: + def __init__(self): + self.sample_rate = 2_000_000 + self.frequency = 27_150_000 + self.bandwidth = 4_000_000 + # Get path of current file + self.angle = 0 + self.forward = 0 + self.backward = 0 + self.signals = path.dirname(path.realpath(__file__)) + "/signals/" + + def move(self, movement_file) -> str: + if movement_file == Direction.LEFT.value: + self.angle += 3 + + + silent = run(["hackrf_transfer", + "-t", f"{self.signals}{movement_file}", + "-f", str(self.frequency), + "-s", str(self.sample_rate), + "-b", str(self.bandwidth), + "-x", "47", + + ], + stdout = DEVNULL, + stderr = DEVNULL + + ) + return movement_file + + def test_move(self): + for direction in Direction: + self.move(direction.value) + sleep(1) + + +if __name__ == "__main__": + car = RCCar() + car.test_move() \ No newline at end of file diff --git a/rc-car/README.md b/rc-car/README.md new file mode 100644 index 0000000..b5de1cd --- /dev/null +++ b/rc-car/README.md @@ -0,0 +1,25 @@ +## RC-Car +This is where I will upload all of the information regarding the RC car hacking. + +

+RC car in the store +

+ +Technical information about the transmitter: +* Uses a [YX 4116 21013](https://www.chinaglobalmall.com/products/559732132610) chip. +* The board is HY-4T69 40M +* Receiver works on 27.15MHz +* Transmitter transmits at 29.15 + +

+RC car transmitter +

+ +## TODOS +* [x] Record + * [x] Forward + * [x] Backward + * [x] Left + * [x] Right +* [ ] Make a cool demo of fine controls +* [ ] Record a cool trick and make it consistent \ No newline at end of file diff --git a/rc-car/Untitled1.ipynb b/rc-car/Untitled1.ipynb new file mode 100644 index 0000000..5697c58 --- /dev/null +++ b/rc-car/Untitled1.ipynb @@ -0,0 +1,107 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "d9d52021-6ba8-48b2-8a0d-e434635c4085", + "metadata": {}, + "outputs": [], + "source": [ + "from RCCar import RCCar, Direction" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "8c491527-223f-4acf-af27-bdb49689e576", + "metadata": {}, + "outputs": [], + "source": [ + "# Defining the car\n", + "car = RCCar()" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "1a055dd5-1ff3-446d-a8e6-9217c1183f0f", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "call hackrf_set_sample_rate(2000000 Hz/2.000 MHz)\n", + "call hackrf_set_baseband_filter_bandwidth(3500000 Hz/3.500 MHz)\n", + "call hackrf_set_hw_sync_mode(0)\n", + "call hackrf_set_freq(27150000 Hz/27.150 MHz)\n", + "Stop with Ctrl-C\n", + " 3.9 MiB / 1.000 sec = 3.9 MiB/second, average power -3.6 dBfs\n", + " 1.1 MiB / 0.265 sec = 4.2 MiB/second, average power -4.6 dBfs\n", + "\n", + "Exiting...\n", + "Total time: 1.26459 s\n", + "hackrf_stop_tx() done\n", + "hackrf_close() done\n", + "hackrf_exit() done\n", + "fclose() done\n", + "exit\n" + ] + }, + { + "data": { + "text/plain": [ + "'Left.complex'" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Moving to the left\n", + "car.move(Direction.LEFT.value)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "758b7a2a-53fb-41aa-883c-d32a233cfd3f", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "20d0cd4a-211c-4b29-af95-3a8d270fcc5d", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/rc-car/moves.py b/rc-car/moves.py new file mode 100644 index 0000000..cc9b133 --- /dev/null +++ b/rc-car/moves.py @@ -0,0 +1,21 @@ +from RCCar import RCCar, Direction +from time import sleep + +def u_turn(car: RCCar): + print("Moving back...") + car.move(Direction.BACKWARD.value) + print("Moving forward...") + car.move(Direction.FORWARD.value) + + print("Turning left...") + for i in range(10): + car.move(Direction.LEFT.value) + + +def main(): + car = RCCar() + u_turn(car) + # 10 + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/rc-car/signals/Back.complex b/rc-car/signals/Back.complex new file mode 100644 index 0000000..b052bd7 Binary files /dev/null and b/rc-car/signals/Back.complex differ diff --git a/rc-car/signals/Fine_back.complex b/rc-car/signals/Fine_back.complex new file mode 100644 index 0000000..4970f06 Binary files /dev/null and b/rc-car/signals/Fine_back.complex differ diff --git a/rc-car/signals/Fine_forward.complex b/rc-car/signals/Fine_forward.complex new file mode 100644 index 0000000..fc68be7 Binary files /dev/null and b/rc-car/signals/Fine_forward.complex differ diff --git a/rc-car/signals/Forward.complex b/rc-car/signals/Forward.complex new file mode 100644 index 0000000..ea982db Binary files /dev/null and b/rc-car/signals/Forward.complex differ diff --git a/rc-car/signals/Left.complex b/rc-car/signals/Left.complex new file mode 100644 index 0000000..4702e7e Binary files /dev/null and b/rc-car/signals/Left.complex differ diff --git a/rc-car/signals/Right.complex b/rc-car/signals/Right.complex new file mode 100644 index 0000000..9d673d1 Binary files /dev/null and b/rc-car/signals/Right.complex differ