реклама на сайте
подробности

 
 
> WF121 последовательность инициализации для режима AP
BSACPLD
сообщение Jun 2 2014, 10:34
Сообщение #1


Местный
***

Группа: Свой
Сообщений: 371
Регистрация: 24-07-05
Из: Москва
Пользователь №: 7 056



Пытаюсь запустить WF121 в режиме точки доступа.
Модуль WF121-A-v1.
Прошивка WF121_enhanced_BGAPI_UART2_115k.hex из SDK.
Инициализирую следующим образом:
CODE

0x08, 0x01, 0x01, 0x01, 0x00
0x08, 0x00, 0x01, 0x02
0x08, 0x01, 0x01, 0x03, 0x00
0x08, 0x07, 0x02, 0x01, 0x00, MAC1_WF121, MAC2_WF121, MAC3_WF121, MAC4_WF121, MAC5_WF121, MAC6_WF121
0x08, 0x01, 0x03, 0x0A, 0x02
0x08, 0x01, 0x03, 0x10, 0x05
0x08, 0x0B, 0x03, 0x0B, 0x00, 0x00, 'E', 'T', 'H', '_', 'U', 'A', 'R', 'T', '\0'
0x08, 0x00, 0x03, 0x00

При выполнении 0x08, 0x0B, 0x03, 0x0B, 0x00, 0x00, 'E', 'T', 'H', '_', 'U', 'A', 'R', 'T', '\0' приходит ошибка 0x0181, а после этого приходит event с ClassID 0x07.
Светодиод отвечающий за отображение статуса радио зажигается, но сеть не появляется.
Подскажите правильную последовательность инициализации данного модуля.
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
BSACPLD
сообщение Jun 8 2014, 04:14
Сообщение #2


Местный
***

Группа: Свой
Сообщений: 371
Регистрация: 24-07-05
Из: Москва
Пользователь №: 7 056



С запуском точки доступа разобрался.
Сделал через скрипты.
Собрал проект на основе примера из wifi_ap (пример из установочника Bluegiga_wifi-1.2.2-63.exe).
Примеры, скачанные с сайта Bluegiga, почему-то не захотели работать.
На приём данные проходят (endpoint_data), а вот на передачу нет (endpoint_send).
Ответных пакетов не видно даже в сниффере.
Ещё также обнаружил странный момент, remote_ip из функции tcpip_endpoint_status всегда равен 0.
Хотя вроде бы он должен содержать адрес компьютера, с которого приходят пакеты.
CODE

const RA = 0
const RB = 1
const RC = 2
const RD = 3
const RE = 4
const RF = 5
const RG = 6

dim ap_channel
dim ap_security
dim ap_ssid(32)
dim ap_ssid_len
dim ap_password(32)
dim ap_password_len
dim ap_max_clients
dim ap_udp_uart_endpoint
dim ap_udp_port_1
dim ap_udp_endpoint_1
dim ap_udp_port_2
dim ap_udp_endpoint_2

event system_boot(major, minor, patch, build, bootloader_version, tcpip_version, hw)
ap_udp_uart_endpoint = 1

ap_channel = 11
ap_security = 2
ap_ssid_len = 11
ap_ssid(0:ap_ssid_len) = "Wi-Fi--UART"
ap_password_len = 16
ap_password(0:ap_password_len) = "Wi-Fi--CycloneIV"
ap_max_clients = 5
ap_udp_port_1 = 1000
ap_udp_endpoint_1 = 0
ap_udp_port_2 = 1024
ap_udp_endpoint_2 = 1

call system_set_max_power_saving_state(0)

call hardware_io_port_config_direction(RD, $0831, $0000)
call hardware_io_port_write(RD, $0831, $0000)
call hardware_io_port_config_direction(RE, $0001, $0000)
call hardware_io_port_write(RE, $0001, $0000)

call sme_set_operating_mode(2)
call sme_set_ap_max_clients(ap_max_clients)
call sme_set_ap_password(ap_password_len, ap_password(0:ap_password_len))
call sme_set_password(ap_password_len, ap_password(0:ap_password_len))

# ON RD4 "WF121 BOOT"
call hardware_io_port_write(RD, $0010, $0010)
end

event sme_wifi_is_on(state)
# ON RD0 "WF121 WIFI"
call hardware_io_port_write(RD, $0001, $0001)

call tcpip_configure(192.168.1.1, 255.255.255.0, 192.168.1.1, 0)

call sme_start_ap_mode(ap_channel, ap_security, ap_ssid_len, ap_ssid(0:ap_ssid_len))
end

event sme_wifi_is_off(state)
# OFF RD0 "WF121 WIFI"
call hardware_io_port_write(RD, $0001, $0000)
end

event sme_ap_mode_started(hw_interface)
# ON RD11 "WF121 AP"
call hardware_io_port_write(RD, $0800, $0800)

call https_enable(0, 1, 0)

call tcpip_start_udp_server(ap_udp_port_1, ap_udp_uart_endpoint)
call tcpip_start_udp_server(ap_udp_port_2, ap_udp_uart_endpoint)
end

event sme_ap_mode_failed(reason, hw_interface)
# ON RD5 "WF121 ERROR", OFF RD11 "WF121 AP"
call hardware_io_port_write(RD, $0820, $0020)
end

event sme_ap_mode_stopped(hw_interface)
# OFF RD11 "WF121 AP"
call hardware_io_port_write(RD, $0800, $0000)
end

event tcpip_endpoint_status(endpoint, local_ip, local_port, remote_ip, remote_port)
if local_port = ap_udp_port_1 && remote_ip != 0
ap_udp_endpoint_1 = endpoint
end if
if local_port = ap_udp_port_2 && remote_ip != 0
ap_udp_endpoint_2 = endpoint
end if
end

event endpoint_status(endpoint, type, streaming, destination, active)
if endpoint = ap_udp_endpoint_1 && active = 1
call endpoint_set_streaming_destination(ap_udp_uart_endpoint, endpoint)
call endpoint_set_streaming_destination(endpoint, ap_udp_uart_endpoint)
end if
if endpoint = ap_udp_endpoint_2 && active = 1
call endpoint_set_streaming_destination(ap_udp_uart_endpoint, endpoint)
call endpoint_set_streaming_destination(endpoint, ap_udp_uart_endpoint)
end if
end

Кто работал с WF121, отзовитесь 1111493779.gif
Уже две недели пытаюсь заставить работать этот гребаный модуль crying.gif

Эскизы прикрепленных изображений
Прикрепленное изображение
 

Прикрепленные файлы
Прикрепленный файл  wifi_ap.rar ( 492.18 килобайт ) Кол-во скачиваний: 18
 
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 25th August 2025 - 11:38
Рейтинг@Mail.ru


Страница сгенерированна за 0.01378 секунд с 7
ELECTRONIX ©2004-2016