mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-06-12 16:00:52 +02:00
added more goodies
This commit is contained in:
parent
902bc7d829
commit
32e3d038d5
43
bm1397_protocol.md
Normal file
43
bm1397_protocol.md
Normal file
@ -0,0 +1,43 @@
|
||||
##BM1397 protocol
|
||||
|
||||
It looks like this setting up the BM1397:
|
||||
```
|
||||
TX: 55 AA 52 05 00 00 0A // also "chippy"??
|
||||
CMD.RX: AA 55 13 97 18 00 00 00 06
|
||||
TX: 55 AA 53 05 00 00 03 //chain inactive
|
||||
TX: 55 AA 53 05 00 00 03 //chain inactive
|
||||
TX: 55 AA 53 05 00 00 03 //chain inactive
|
||||
TX: 55 AA 40 05 00 00 1C //"chippy"??
|
||||
TX: 55 AA 51 09 00 80 00 00 00 00 1C //init1
|
||||
TX: 55 AA 51 09 00 84 00 00 00 00 11 //init2
|
||||
TX: 55 AA 51 09 00 20 00 00 00 01 02 //init3
|
||||
TX: 55 AA 51 09 00 3C 80 00 80 74 10 //init4
|
||||
TX: 55 AA 51 09 00 14 00 00 00 00 1C //set_ticket
|
||||
TX: 55 AA 51 09 00 68 C0 70 01 11 00 //init5
|
||||
TX: 55 AA 51 09 00 68 C0 70 01 11 00 //init5 (2x)
|
||||
TX: 55 AA 51 09 00 28 06 00 00 0F 18 //init6
|
||||
TX: 55 AA 51 09 00 18 00 00 7A 31 15 //baudrate
|
||||
TX: 55 AA 51 09 00 70 0F 0F 0F 00 19 //prefreq
|
||||
TX: 55 AA 51 09 00 70 0F 0F 0F 00 19 //prefreq
|
||||
TX: 55 AA 51 09 00 08 40 A0 02 25 16 //freqbuf
|
||||
TX: 55 AA 51 09 00 08 40 A0 02 25 16 //freqbuf
|
||||
```
|
||||
|
||||
Sending work to the BM1397 looks like this;
|
||||
```
|
||||
TX: 55 AA 21 96 04 04 00 00 00 00 72 E7 07 17 A9 81 51 63 EE D6 E5 43 35 3F 14 92 56 25 54 19 4E 41 31 08 E5 D7 89 4A C8 13 50 A4 48 05 B8 0E E2 E4 83 95 F8 C1 15 8D EC 07 D8 B8 AE CA DE E6 35 8C 3E E9 1C 57 5D 99 A7 52 95 DC D8 08 7B 7A D
|
||||
```
|
||||
|
||||
How does this big work field break down?
|
||||
|
||||
`55 AA` ->
|
||||
`21` -> always 21. like bitcoin, always 21 million coins?
|
||||
`96` -> length
|
||||
`04` -> jobID
|
||||
`04` -> midstates
|
||||
`00 00 00 00` -> always zero. Is this the starting nonce?
|
||||
`72 E7 07 17` -> nbits
|
||||
`A9 81 51 63` -> ntime
|
||||
`EE D6 E5 43` -> last 4 bytes of the merkle root
|
||||
`35 3F 14 92 56 25 54 19 4E 41 31 08 E5 D7 89 4A C8 13 50 A4 48 05 B8 0E E2 E4 83 95 F8 C1 15 8D` -> midstate computed from the first 64 bytes of the header
|
||||
`EC 07 D8 B8 AE CA DE E6 35 8C 3E E9 1C 57 5D 99 A7 52 95 DC D8 08 7B 7A D` -> ?? another midstate?
|
@ -12,15 +12,17 @@ ESP-Miner is bitcoin miner software designed to run on the ESP32. It mines on AS
|
||||
### Firmware
|
||||
- ESP-Miner connects to and verifies the attached mining ASIC.
|
||||
- Setting the baud rate, hashing frequency, and filling in some other mystery registers
|
||||
- This startup-sequence for the BM1387 and BM1397 can be found in cgminer the Kano edition in [driver-gekko.c](https://github.com/kanoi/cgminer/blob/master/driver-gekko.c)
|
||||
- This startup sequence for the BM1387 and BM1397 can be found in cgminer the Kano edition in [driver-gekko.c](https://github.com/kanoi/cgminer/blob/master/driver-gekko.c)
|
||||
|
||||
- ESP-Miner connects to your pool or stratum server and subscribes to get the latest work.
|
||||
- This is done with [JSON-RPC](https://www.jsonrpc.org)
|
||||
- Via the [Stratum](https://braiins.com/stratum-v1/docs) protocol
|
||||
- ESP-Miner the latest work and formats it to be sent to the mining ASIC.
|
||||
- [cJSON](https://github.com/DaveGamble/cJSON) seems like a good embedded library for doing this.
|
||||
- ESP-Miner gets the latest work and formats it to be sent to the mining ASIC.
|
||||
- There isn't much change here except for computing the midstates, and shifting some bytes around
|
||||
- Beware of endianess!
|
||||
- How do we do this? Examples in cgminer Kano edition.
|
||||
- I have started on this.. [check this](nm1397_protocol.md)
|
||||
- ESP-Miner sends this work to the mining ASIC over serial.
|
||||
|
||||
- The Mining ASIC will report back any when it finds a hash over the difficulty (which)?
|
||||
|
Loading…
x
Reference in New Issue
Block a user