Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add network support by omersiar #747

Open
wants to merge 61 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
07fead8
initial network support
omersiar Nov 5, 2024
0a9eb7f
add build.sh
omersiar Nov 5, 2024
893b9f6
working RTP and UDP poc
omersiar Nov 5, 2024
2046d81
init network after minidexed starts
omersiar Nov 6, 2024
2ad3301
some cleanup
omersiar Nov 6, 2024
8d5eef9
write IP address to LCD
omersiar Nov 7, 2024
aeeceae
some more cleanup
omersiar Nov 8, 2024
df387fa
clean up
omersiar Nov 8, 2024
b66058b
try to resolve conflicts
omersiar Nov 8, 2024
dc2a8b4
comma conflict
omersiar Nov 8, 2024
db2534d
try to resolve conflict
omersiar Nov 8, 2024
d6a2c6a
fix init order
omersiar Nov 8, 2024
ea8f5f7
clean net directory as well
omersiar Nov 8, 2024
65f7d6b
Merge pull request #744 from omersiar/network
probonopd Nov 9, 2024
3a1f7e5
Add Network section to minidexed.ini
probonopd Nov 9, 2024
bb1f352
Add WLAN firmware and wpa_supplicant.conf
probonopd Nov 9, 2024
f544715
Use "WLAN" terminology
probonopd Nov 9, 2024
0b69e35
Update submod.sh
probonopd Nov 9, 2024
084dca9
Add initial mdns responder for rtp-midi aka applemidi (#749)
probonopd Nov 9, 2024
3a673dd
circle: git checkout c243194
probonopd Nov 9, 2024
d9e32a1
circle: git checkout 59484ba (develop)
probonopd Nov 9, 2024
c5e338e
Update submod.sh
probonopd Nov 9, 2024
8d26e20
circle: git checkout c243194 (master)
probonopd Nov 9, 2024
2a6d966
Use "MiniDexed" as the mDNS-SD service name
probonopd Nov 9, 2024
a2f8b4c
Try to also publish _ftp._tcp
probonopd Nov 9, 2024
20a6ec8
ServiceTypeFTP
probonopd Nov 9, 2024
0e484ac
Shorten mDNS interval to 15 seconds
probonopd Nov 9, 2024
f7e7556
Patch include/circle/net/mdnspublisher.h
probonopd Nov 9, 2024
bf3a93b
Put git hash in startup message
probonopd Nov 9, 2024
3e64e44
Patch src/userinterface.cpp
probonopd Nov 9, 2024
29b5d05
Put build date into startup message
probonopd Nov 9, 2024
b822a97
Rebased network changes (#751)
omersiar Nov 9, 2024
a95d6e0
Network (#753)
probonopd Nov 14, 2024
024d23a
Step47 Network Support without mDNS (#757)
omersiar Nov 15, 2024
d331dfa
Display IP address in upper line of the display
probonopd Nov 16, 2024
9fcacb2
Don't write "IP" to save space for the IP address
probonopd Nov 16, 2024
3ab17cf
Merge branch 'main' into network
probonopd Nov 16, 2024
3c35244
NetworkType ( wifi ; ethernet )
probonopd Nov 16, 2024
02b709d
Backport mdnspublisher from Circle (#761)
omersiar Nov 16, 2024
41be649
Remove TTL patching
probonopd Nov 16, 2024
7ca6e29
Add all network configuration keys
probonopd Nov 16, 2024
0171b87
Default hostname to "MiniDexed"
probonopd Nov 16, 2024
ad5140a
Do not hardcode service name
probonopd Nov 16, 2024
3d9a339
Also publish _ftp._tcp
probonopd Nov 16, 2024
99319d4
m_pmDNSPublisher
probonopd Nov 16, 2024
f8a5ee5
Add NetworkDNSServer (fix typo)
probonopd Nov 16, 2024
decd737
Prevent wpa_supplicant.conf from being downloaded
probonopd Nov 16, 2024
2b619b0
/SD/wpa_supplicant.conf
probonopd Nov 16, 2024
9a6c782
"wpa_supplicant.conf"
probonopd Nov 16, 2024
a9921e4
Add logging over the network to a syslog server
probonopd Nov 17, 2024
2fbb9d2
Apply patch to prevent wpa_supplicant.conf from being downloaded
probonopd Nov 17, 2024
b59af14
Remove compiler warnings
probonopd Nov 17, 2024
46ccb9c
Do not hardcode syslog server
probonopd Nov 17, 2024
84525eb
Support MIDIDumpEnabled=1 to syslog
probonopd Nov 17, 2024
9142a8e
Use custom Dockerfile for GitHub Codespaces
probonopd Nov 17, 2024
77cf106
Move .devcontainer in place
probonopd Nov 17, 2024
cd93cac
Start build when Codespace starts
probonopd Nov 17, 2024
5cabb8c
Revert Dockerfile
probonopd Nov 17, 2024
7eda0d1
Revert unrelated change
probonopd Nov 19, 2024
6e7ee27
Merge branch 'main' into network
probonopd Dec 19, 2024
ac27acc
Merge branch 'main' into network
probonopd Dec 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
export PATH=$(readlink -f ./gcc-*arm-none*/bin/):$PATH
RPI=1 bash -ex build.sh
cp ./src/kernel*.img ./kernels/
- name: Get Raspberry Pi boot files
- name: Get Raspberry Pi boot files and WLAN firmware
run: |
set -ex
export PATH=$(readlink -f ./gcc-*aarch64-none*/bin/):$PATH
Expand All @@ -77,12 +77,18 @@ jobs:
cd sdcard
cp ../kernels/* . || true
cd -
# WLAN firmware
cp circle-stdlib/libs/circle/addon/wlan/sample/hello_wlan/wpa_supplicant.conf sdcard/
mkdir -p sdcard/firmware
cd sdcard/firmware
make -f ../../circle-stdlib/libs/circle/addon/wlan/firmware/Makefile
cd -
- name: Get performance files
run: |
git clone https://github.com/Banana71/Soundplantage --depth 1 # depth 1 means only the latest commit
cp -r ./Soundplantage/performance ./Soundplantage/*.pdf ./sdcard/
cd sdcard
zip -r ../MiniDexed_$GITHUB_RUN_NUMBER_$(date +%Y-%m-%d)-$(git rev-parse --short HEAD).zip *
zip -r ../MiniDexed_$GITHUB_RUN_NUMBER_$(date +%Y%m%d)-$(git rev-parse --short HEAD).zip *
echo "artifactName=MiniDexed_$GITHUB_RUN_NUMBER_$(date +%Y-%m-%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
cd -
- name: Hardware configration files
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ sdcard
*.swp
*.swo

CMSIS_5/
Synth_Dexed/
circle-stdlib/
CMSIS_5/**
Synth_Dexed/**
circle-stdlib/**
.vscode/
minidexed_*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[submodule "circle-stdlib"]
path = circle-stdlib
url = https://github.com/smuehlst/circle-stdlib
ignore = all
[submodule "Synth_Dexed"]
path = Synth_Dexed
url = https://codeberg.org/dcoredump/Synth_Dexed.git
ignore = all
[submodule "CMSIS_5"]
path = CMSIS_5
url = https://github.com/ARM-software/CMSIS_5
ignore = all
2 changes: 1 addition & 1 deletion Synth_Dexed
Submodule Synth_Dexed updated from 8c677c to c9f527
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ if [ "${RPI}" -gt "1" ]; then
OPTIONS="${OPTIONS} -o ARM_ALLOW_MULTI_CORE"
fi

# For wireless access
if [ "${RPI}" == "3" ]; then
OPTIONS="${OPTIONS} -o USE_SDHOST"
fi

# USB Vendor and Device ID for use with USB Gadget Mode
source USBID.sh
if [ "${USB_VID}" ] ; then
Expand All @@ -39,6 +44,11 @@ make -j
cd libs/circle/addon/display/
make clean || true
make -j

cd ../wlan/
make clean || true
make -j

cd ../sensor/
make clean || true
make -j
Expand Down
6 changes: 4 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
CIRCLE_STDLIB_DIR = ../circle-stdlib
SYNTH_DEXED_DIR = ../Synth_Dexed/src
CMSIS_DIR = ../CMSIS_5/CMSIS
NET_DIR = ./net

OBJS = main.o kernel.o minidexed.o config.o userinterface.o uimenu.o \
mididevice.o midikeyboard.o serialmididevice.o pckeyboard.o \
mididevice.o udpmididevice.o midikeyboard.o serialmididevice.o pckeyboard.o \
sysexfileloader.o performanceconfig.o perftimer.o \
effect_compressor.o effect_platervbstereo.o uibuttons.o midipin.o
effect_compressor.o effect_platervbstereo.o uibuttons.o midipin.o \
net/ftpdaemon.o net/ftpworker.o net/applemidi.o net/udpmidi.o net/mdnspublisher.o

OPTIMIZE = -O3

Expand Down
10 changes: 8 additions & 2 deletions src/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ include $(CIRCLEHOME)/Rules.mk

INCLUDE += \
-I $(CIRCLE_STDLIB_DIR)/include \
-I $(NEWLIBDIR)/include
-I $(NEWLIBDIR)/include \
-I $(NET_DIR)

LIBS += \
$(NEWLIBDIR)/lib/libm.a \
Expand All @@ -28,6 +29,11 @@ LIBS += \
$(CIRCLEHOME)/addon/fatfs/libfatfs.a \
$(CIRCLEHOME)/lib/fs/libfs.a \
$(CIRCLEHOME)/lib/sched/libsched.a \
$(CIRCLEHOME)/lib/libcircle.a
$(CIRCLEHOME)/lib/libcircle.a \
$(CIRCLEHOME)/addon/wlan/hostap/wpa_supplicant/libwpa_supplicant.a \
$(CIRCLEHOME)/addon/wlan/libwlan.a \
$(CIRCLEHOME)/lib/net/libnet.a

EXTRACLEAN += $(NET_DIR)/*.d $(NET_DIR)/*.o

-include $(DEPS)
1 change: 1 addition & 0 deletions src/circle_stdlib_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ class CStdlibAppStdio: public CStdlibAppScreen
CEMMCDevice mEMMC;
FATFS mFileSystem;
CConsole mConsole;
CScheduler mScheduler;
};

/**
Expand Down
62 changes: 62 additions & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,22 @@ void CConfig::Load (void)
m_bProfileEnabled = m_Properties.GetNumber ("ProfileEnabled", 0) != 0;
m_bPerformanceSelectToLoad = m_Properties.GetNumber ("PerformanceSelectToLoad", 1) != 0;
m_bPerformanceSelectChannel = m_Properties.GetNumber ("PerformanceSelectChannel", 0);

// Network
m_bNetworkEnabled = m_Properties.GetNumber ("NetworkEnabled", 0) != 0;
m_bNetworkDHCP = m_Properties.GetNumber ("NetworkDHCP", 0) != 0;
m_NetworkType = m_Properties.GetString ("NetworkType", "wifi");
m_NetworkHostname = m_Properties.GetString ("NetworkHostname", "MiniDexed");
m_INetworkIPAddress = m_Properties.GetIPAddress("NetworkIPAddress") != 0;
m_INetworkSubnetMask = m_Properties.GetIPAddress("NetworkSubnetMask") != 0;
m_INetworkDefaultGateway = m_Properties.GetIPAddress("NetworkDefaultGateway") != 0;
m_INetworkDNSServer = m_Properties.GetIPAddress("NetworkDNSServer") != 0;

const u8 *pSyslogServerIP = m_Properties.GetIPAddress ("NetworkSyslogServerIPAddress");
if (pSyslogServerIP)
{
m_INetworkSyslogServerIPAddress.Set (pSyslogServerIP);
}
}

unsigned CConfig::GetToneGenerators (void) const
Expand Down Expand Up @@ -716,3 +732,49 @@ unsigned CConfig::GetPerformanceSelectChannel (void) const
{
return m_bPerformanceSelectChannel;
}

// Network
bool CConfig::GetNetworkEnabled (void) const
{
return m_bNetworkEnabled;
}

bool CConfig::GetNetworkDHCP (void) const
{
return m_bNetworkDHCP;
}

const char *CConfig::GetNetworkType (void) const
{
return m_NetworkType.c_str();
}

const char *CConfig::GetNetworkHostname (void) const
{
return m_NetworkHostname.c_str();
}

CIPAddress CConfig::GetNetworkIPAddress (void) const
{
return m_INetworkIPAddress;
}

CIPAddress CConfig::GetNetworkSubnetMask (void) const
{
return m_INetworkSubnetMask;
}

CIPAddress CConfig::GetNetworkDefaultGateway (void) const
{
return m_INetworkDefaultGateway;
}

CIPAddress CConfig::GetNetworkDNSServer (void) const
{
return m_INetworkDNSServer;
}

CIPAddress CConfig::GetNetworkSyslogServerIPAddress (void) const
{
return m_INetworkSyslogServerIPAddress;
}
23 changes: 23 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#ifndef _config_h
#define _config_h

#include <circle/net/ipaddress.h>
#include <fatfs/ff.h>
#include <Properties/propertiesfatfsfile.h>
#include <circle/sysconfig.h>
Expand Down Expand Up @@ -238,6 +239,17 @@ class CConfig // Configuration for MiniDexed
bool GetPerformanceSelectToLoad (void) const;
unsigned GetPerformanceSelectChannel (void) const;

// Network
bool GetNetworkEnabled (void) const;
const char *GetNetworkType (void) const;
bool GetNetworkDHCP (void) const;
const char *GetNetworkHostname (void) const;
CIPAddress GetNetworkIPAddress (void) const;
CIPAddress GetNetworkSubnetMask (void) const;
CIPAddress GetNetworkDefaultGateway (void) const;
CIPAddress GetNetworkDNSServer (void) const;
CIPAddress GetNetworkSyslogServerIPAddress (void) const;

private:
CPropertiesFatFsFile m_Properties;

Expand Down Expand Up @@ -351,6 +363,17 @@ class CConfig // Configuration for MiniDexed
bool m_bProfileEnabled;
bool m_bPerformanceSelectToLoad;
unsigned m_bPerformanceSelectChannel;

// Network
bool m_bNetworkEnabled;
bool m_bNetworkDHCP;
std::string m_NetworkType;
std::string m_NetworkHostname;
CIPAddress m_INetworkIPAddress;
CIPAddress m_INetworkSubnetMask;
CIPAddress m_INetworkDefaultGateway;
CIPAddress m_INetworkDNSServer;
CIPAddress m_INetworkSyslogServerIPAddress;
};

#endif
5 changes: 4 additions & 1 deletion src/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@
#include <circle/usb/usbhcidevice.h>
#include "usbminidexedmidigadget.h"

#define NET_DEVICE_TYPE NetDeviceTypeWLAN // or: NetDeviceTypeWLAN

LOGMODULE ("kernel");

CKernel *CKernel::s_pThis = 0;

CKernel::CKernel (void)
: CStdlibAppStdio ("minidexed"),
:
CStdlibAppStdio ("minidexed"),
m_Config (&mFileSystem),
m_GPIOManager (&mInterrupt),
m_I2CMaster (CMachineInfo::Get ()->GetDevice (DeviceI2CMaster), TRUE),
Expand Down
1 change: 1 addition & 0 deletions src/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <circle/i2cmaster.h>
#include <circle/spimaster.h>
#include <circle/usb/usbcontroller.h>
#include <circle/sched/scheduler.h>
#include "config.h"
#include "minidexed.h"

Expand Down
14 changes: 6 additions & 8 deletions src/mididevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
if ( pMessage[0] != MIDI_TIMING_CLOCK
&& pMessage[0] != MIDI_ACTIVE_SENSING)
{
fprintf (stderr, "MIDI%u: %02X\n", nCable, (unsigned) pMessage[0]);
LOGNOTE ("MIDI%u: %02X\n", nCable, (unsigned) pMessage[0]);
}
break;

case 2:
fprintf (stderr, "MIDI%u: %02X %02X\n", nCable,
LOGNOTE ("MIDI%u: %02X %02X\n", nCable,
(unsigned) pMessage[0], (unsigned) pMessage[1]);
break;

case 3:
fprintf (stderr, "MIDI%u: %02X %02X %02X\n", nCable,
LOGNOTE ("MIDI%u: %02X %02X %02X\n", nCable,
(unsigned) pMessage[0], (unsigned) pMessage[1],
(unsigned) pMessage[2]);
break;
Expand All @@ -163,17 +163,17 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
switch(pMessage[0])
{
case MIDI_SYSTEM_EXCLUSIVE_BEGIN:
fprintf(stderr, "MIDI%u: SysEx data length: [%d]:",nCable, uint16_t(nLength));
LOGNOTE("MIDI%u: SysEx data length: [%d]:",nCable, uint16_t(nLength));
for (uint16_t i = 0; i < nLength; i++)
{
if((i % 16) == 0)
fprintf(stderr, "\n%04d:",i);
fprintf(stderr, " 0x%02x",pMessage[i]);
}
fprintf(stderr, "\n");
LOGNOTE("\n");
break;
default:
fprintf(stderr, "MIDI%u: Unhandled MIDI event type %0x02x\n",nCable,pMessage[0]);
LOGNOTE("MIDI%u: Unhandled MIDI event type %0x02x\n",nCable,pMessage[0]);
}
break;
}
Expand Down Expand Up @@ -302,7 +302,6 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
{
if ((ucChannel == nPerfCh) || (nPerfCh == OmniMode))
{
//printf("Performance Select Channel %d\n", nPerfCh);
m_pSynthesizer->ProgramChangePerformance (pMessage[1]);
}
}
Expand Down Expand Up @@ -357,7 +356,6 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign
{
break;
}

m_pSynthesizer->keyup (pMessage[1], nTG);
break;

Expand Down
Loading