#Open Sesame Plugin

26 messages · Page 1 of 1 (latest)

sly creek
#

Need help for this modified code to run on flipper. I think I got the code right. This is for testing only if this is able to work do not use it with any bad intent or with out permission's.

cosmic mesa
#

That's python. I'm pretty sure you can't run that on a flipper zero...

sly creek
#

Flipper officially supports Python 3.6 – 3.9. It also runs on PyPy and Sage. To get the best performance, ensure that cypari (>= 2.4. 0) or cypari2 is installed or run from it within Sage.

cosmic mesa
#

I can't find that in the documentation. Could you send me a link?

sly creek
cosmic mesa
#

Oh wait, I thought you're talking about the flipper zero running python

sly creek
#

No but the flipper can use python

#

Right?

cosmic mesa
#

I have no idea about python stuff, sorry.

sly creek
#

Open Sesame Plugin

sly creek
#

#include <stdio.h>
#include <string.h>

#define N 4 // number of characters in set
#define LEN 4096 // length of De Bruijn sequence

int main() {
char set[N] = {'A', 'C', 'G', 'T'}; // set of characters
char s[LEN]; // De Bruijn sequence
int i;

// Initialize s with first N characters of set
for (i = 0; i < N; i++) {
s[i] = set[i];
}

// Generate De Bruijn sequence
while (strlen(s) < LEN) {
for (i = 0; i < N; i++) {
strcat(s, s + i + 1);
}
}

// Truncate De Bruijn sequence to desired length
s[LEN - 1] = '\0';

printf("De Bruijn sequence: %s\n", s);
return 0;
}

#

For other file

errant blade
sly creek
#

#include <stdio.h>
#include <string.h>
#include "cc1101.h" // CC1101 header file
#include "subghz.h" // Flipper Zero sub-GHz API header file

#define N 2 // number of characters in set (binary "0" and "1")
#define LEN 4096 // length of De Bruijn sequence

int main() {
// Generate De Bruijn sequence
char set[N] = {'0', '1'};
char s[LEN];
int i;
for (i = 0; i < N; i++) {
s[i] = set[i];
}
while (strlen(s) < LEN) {
for (i = 0; i < N; i++) {
strcat(s, s + i + 1);
}
}
s[LEN - 1] = '\0';

// Initialize CC1101 chip and Flipper Zero sub-GHz API
cc1101_init();
subghz_init();

// Transmit De Bruijn sequence on each of the specified frequencies
int frequencies[5] = {390, 315, 318, 310, 300};
for (i = 0; i < 5; i++) {
cc1101_set_frequency(frequencies[i]);
subghz_send(s, strlen(s));
}

return 0;
}

cosmic mesa
#

btw you could use code Blocks

sly creek
#

Wait did not think about that

#

How does this look

#

#include <stdio.h>
#include <string.h>
#include "cc1101.h" // CC1101 header file
#include "subghz.h" // Flipper Zero sub-GHz API header file

#define N 2 // number of characters in set (binary "0" and "1")
#define LEN 4096 // length of De Bruijn sequence

int main() {
// Generate De Bruijn sequence
char set[N] = {'0', '1'};
char s[LEN];
int i;
for (i = 0; i < N; i++) {
s[i] = set[i];
}
while (strlen(s) < LEN) {
for (i = 0; i < N; i++) {
strcat(s, s + i + 1);
}
}
s[LEN - 1] = '\0';

// Initialize CC1101 chip and Flipper Zero sub-GHz API
cc1101_init();
subghz_init();

// Transmit De Bruijn sequence on each of the specified frequencies
int frequencies[5] = {390, 315, 318, 310, 300};
for (i = 0; i < 5; i++) {
// Set the frequency using the CC1101 chip
cc1101_set_frequency(frequencies[i]);
// Use the Flipper Zero sub-GHz API to transmit the De Bruijn sequence
subghz_send(s, strlen(s));
}

return 0;
}

#

I forgot I just need to use flipper api not cc1101 api

#

I'm think I got it can't test it but can some one test it for me I'll send the steps

#

Code............................................

#

#include <stdio.h>
#include <string.h>
#include "subghz.h" // Flipper Zero sub-GHz API header file

#define N 2 // number of characters in set (binary "0" and "1")
#define LEN 4096 // length of De Bruijn sequence

int main() {
// Generate De Bruijn sequence
char set[N] = {'0', '1'};
char s[LEN];
int i;
for (i = 0; i < N; i++) {
s[i] = set[i];
}
while (strlen(s) < LEN) {
for (i = 0; i < N; i++) {
strcat(s, s + i + 1);
}
}
s[LEN - 1] = '\0';

// Initialize Flipper Zero sub-GHz API
subghz_init();

// Transmit De Bruijn sequence on each of the specified frequencies
int frequencies[5] = {390, 315, 318, 310, 300};
for (i = 0; i < 5; i++) {
// Use the Flipper Zero sub-GHz API to transmit the De Bruijn sequence on the specified frequency
subghz_send(s, strlen(s));
}

return 0;
}

To compile this code, you can use the following command:

arm-none-eabi-gcc -o main main.c subghz.c

This will create an executable file named "main" that can be run on the Flipper Zero. You may need to specify the path to the header file (subghz.h) if it is not in the same directory as the source files.

You can then transfer the executable file to the Flipper Zero and run it using the appropriate command line tools or by using a debugger.

sly creek
#

To generate a stand-alone executable file for the Flipper Zero, you will need to follow these steps:

Install a cross compiler and the necessary development tools on your system. The Flipper Zero uses an ARM Cortex-M0 processor, so you will need a cross compiler that can generate code for ARM Cortex-M0 processors.

Save the code you want to compile in a file named "main.c".

Use the cross compiler to generate object files for the code and any necessary dependencies. You can do this using the following command:

arm-none-eabi-gcc -c main.c subghz.c

This will generate object files named "main.o" and "subghz.o".

Use the cross-linker to generate a stand-alone executable file from the object files and any necessary dependencies. You can do this using the following command:
arm-none-eabi-gcc -o main main.o subghz.o -lm -lc

This will create an executable file named "main" that includes the necessary dependencies.

Transfer the executable file to the Flipper Zero using a suitable method such as a USB connection or a network share.

Connect to the Flipper Zero using a terminal emulator or a debugger.

Run the executable file on the Flipper Zero using the appropriate command or debugger command.

sly creek
#

Import the necessary libraries

import flipper
import string

Define the number of characters in the set (binary "0" and "1")

N = 2

Define the length of the De Bruijn sequence

LEN = 4096

Generate the De Bruijn sequence

set = [ch for ch in string.ascii_lowercase[:N]]
s = set[:]
while len(s) < LEN:
for i in range(N):
s.extend(s[i + 1:])
s = s[:LEN]

Initialize Flipper Zero

flipper.init()

Transmit the De Bruijn sequence on each of the specified frequencies

frequencies = [390, 315, 318, 310, 300]
for frequency in frequencies:

Use the Flipper Zero built-in software to transmit the De Bruijn sequence on the specified frequency

flipper.send(s, frequency)

viscid fiber
#

Flipper Zero does not support Python (even microPython), cause it doesn't fit into the flash memory